Pages - Menu
HOME
GADGETS
ANDROID
SOFTWARES
COMPUTER TRICKS
ABOUT US
PRIVACY DISCLAIMER
CONTACT
Program for Prime Number
#include<stdio.h>
#include<conio.h>
main()
{
int n,a,j,i,t=0;
clrscr();
printf("enter the value of n");
scanf("%d",&n);
for(j=1;j<=n;j++)
{
t=0;
for(i=2;i<=j-1;i++)
{
a=j%i;
if(a==0)
{
t=t+1;
}
}
if(t==0)
printf("%d\n",j);
}
getch();
}�
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment