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

How did Washington suggest changes to the government should be made?
Which sentence should be revised to be more precise?
1/9 rational or irrational.
Please help you will get 25 points and I will try to give brainiest from President John F. Kennedy's Inaugural Address, 1961 ...In your hands, my fellow citize
Find the LCM of 4 and 9
Find the area of the circle and enter your answer below. Leave Pl in the answer (do not multiply by Pl) Area = πm2 15 m​
If the area of traingle TQR is 60 cm square,what is the area of the parallelogram PQRS?​
Can ya help me with my Spanish? Label the correct verb to each number-
Which action will decrease the gravitational force between two objects? A. Reducing the masses of the objects B. Increasing the charge on one of the objects C.
What did Ancient Kush and Egypt have in common? A:They both had Pharaohs. B:They both had Pyramids. C:They both used the Nile. D:All of the above.