Write a Program to Display 1 To 99 prime Number Using Loop
void main()
{
int no,n,c,j;
clrscr();
printf("Prime Number Among 1 To 99");
printf("\n************************");
no=1;
do
{
n=no;
c=0;
j=1;
while (n>=j)
{
if(n%j==0)
{
c++;
}
j++;
}
if(c==2)
{
printf("\n%d",no);
}
no++;
} while(no<=99);
printf("\n**********************");
getch();
}
{
int no,n,c,j;
clrscr();
printf("Prime Number Among 1 To 99");
printf("\n************************");
no=1;
do
{
n=no;
c=0;
j=1;
while (n>=j)
{
if(n%j==0)
{
c++;
}
j++;
}
if(c==2)
{
printf("\n%d",no);
}
no++;
} while(no<=99);
printf("\n**********************");
getch();
}
Write a Program to Display 1 To 99 prime Number Using Loop
Reviewed by Unknown
on
21:19
Rating:
No comments: