Program to find a number is Prime Or Not January 01, 2018 Programing In C No comments #include<conio.h> #include<stdio.h> void main() { int i,n,c; clrscr(); printf("Enter the value of N"); scanf("%d",&n); for(i=2;i<n;i++) { c=n%i; if(c==0)\ { printf("N is not a prime Number"); } if(c!=0) { printf("N is a prime number"); } getch(); } Output Enter the value of N=29 prime number Enter the value of N=75 N is not a prime number Share This: Facebook Twitter Google+ Stumble Digg Email ThisBlogThis!Share to XShare to Facebook
0 comments:
Post a Comment