Find the prime numbers between 1 and 100
#include
#include
#include
void main()
{
int i,j,n,p;
clrscr();
int flag;
for(i=1;i<=100;i++)
{
p=i;
flag=1;
for(j=2;j<=p/2;j++)
if((p%j)= = 0)
{
flag=0;
break;
}
if(flag= = 1)
cout<
}
getch();
}
Monday, December 7, 2009
Home »
C++ PROGRAM FOR PRIME NUMBER
,
CALCULATE PRIME NUMBER USING C++
,
PRIME NUMBERS USING C++
» C++->PRIME NUMBERS
C++->PRIME NUMBERS
5:02 AM
C++ PROGRAM FOR PRIME NUMBER, CALCULATE PRIME NUMBER USING C++, PRIME NUMBERS USING C++
No comments
0 comments:
Post a Comment