Post Top Ad

Your Ad Spot

Pages

Friday, 7 February 2020

WRITE A PROGRAM NUMBER IS PRIME OR NOT

#include<stdio.h>
#include<conio.h>
// NO IS PRIME OR NOT
int Isprime(int no)
{
int i;
for(i=2;i<=no/2;i++)
{
if(no%i==0)
return 0;
}
return 1;
}
void main()

   int x;
   printf("%d",Isprime(18));
}

No comments:

Post a Comment

Post Top Ad

Your Ad Spot

Pages