//Write a program to check the number is prime or not #include<stdio.h> #include<conio.h> void main() { int i,n,count=0; clrscr(); printf("Enter any number:\n"); scanf("%d",&n); for(i=2;i<=n/2;i++) { if(n%i==0) { count++; break; } } if(coutn==0) printf("%d is prime number",n); else printf("%d is not prime number",n); getch(); }
Comments
Post a Comment