Menu

C program for finding prime number


void main()
{
int n,i,sam=0;
printf("Enter a no:");
scanf("%d",&n);
for(i=2;i<=n/2;i++)
{
if(n%i==0)
sam=1;
}
if(sam==1)
printf("\n%d is not a prime no.",n);
else
printf("\n%d is a prime no.",n);
}










Connection failed: SQLSTATE[28000] [1045] Access denied for user 'studentdb'@'localhost' (using password: YES)

Subscribe