#include <iostream>
#include <conio.h>
#include <stdio.h>
using namespace std ;
int main ( )
{
int n , i , count=0 ;
for ( n = 500 ; n <= 3000 ; n++ )
{
for ( i = 500 ; i < n ; i++ )
{
if( n % i == 0 )
break ;
}
if ( n == i )
{
count++ ;
cout << n << endl ;
}
}
cout <<" Total prime numbers are "<< count ;
return 0 ;
}
No comments:
Post a Comment
Must drop your comments about post.