Computer Science, asked by hashmdfuzail24, 1 year ago

Write the C++ to print the prime numbers between 100-200.

Answers

Answered by mebijay
2
#include<iostream>
#include<math.h>
using namespace std;

int main( ){

int c = 0;

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

c = 0;

for(int j = 2; j<=sqrt(i); j++){

if( i % j == 0 ){
c++;
break;
}
}

if ( c == 0 )
cout<< i <<endl;


}

}
Similar questions