C++ Program to find out the list of prime numbers.
#include <iostream>
using namespace std ;
int main ( )
{ int n , i ; for ( n=2 ; n<= 100 ; n++ ) { for ( i=2 ; i<n ; i++ ) { if ( n%i == 0) break ; } if ( i == n ) { cout << n << endl ; } } return 0 ;
}
No comments:
Post a Comment
Must drop your comments about post.