ramylan00
ramylan00 ramylan00
  • 12-12-2020
  • Computers and Technology
contestada

write c++ program from 1to 100 to find prime numbers using statement.

please help me​

write c program from 1to 100 to find prime numbers using statementplease help me class=

Respuesta :

th3g3ntl3man
th3g3ntl3man th3g3ntl3man
  • 19-12-2020

Answer:

int count;

for (int i = 1; i <= 100; i++){

count = 0;

for (int j = 1; j <=i; j++)

if (i%j==0) count ++;

if (count == 2) cout << i << " ";

}

Answer Link

Otras preguntas

a 3 pound pork loin can be cut into 10 pork chops of equal weigth. how many ounces is each pork chop?
One purpose of the executive branch is to interpret laws made by Congress. command the armed forces. create and pass new laws. oversee a system of courts.
Which one of the following frequencies of a wave in the air can be heard as an audible sound by the human ear? A. 1,000 Hz B. 100,000 Hz C. 0.10 Hz D. 10 Hz
The 18 powers of Congress are known as ____ powers. A. legislative B. judicial C. ultimate D. enumerated
In the short story "rhinoceros" the image of the rhinoceros is used to connect all of the following literary elements EXCEPT, A. Characters B. Theme C. Situatio
a rectangle measures 13 cm by 5 cm what is its area
how the Crusades and the Renaissance influence exploration of the world?
Tuesday at the zoo, 5/12 of the visitors were adults. Of these adults, 3/10 were men. What fraction of the people who visited the zoo on Tuesday were men?
Evaluate the expression described below if the number is –3. Four less than three times the sum of a number and four. A.–9 B.–1 C.9 D.1
243.875 to nearest tenth, hundredth, ten, and hundred.