C program to check a given number is prime number or not
#include<stdio.h> int main( ) { int n, i, k=0; printf("Enter the number"); scanf("%d",&n); for(i=2; i<n; i++) { if(n%i==0) k++; } if(k==0) printf("%d is prime number",n); else printf("%d is not prime number",n); return 0; }
0 Comments