/*Write a fucntion prime which returns 1 is argument is prime no otherwise 0 Program No : 30 of GTU Practice Programs Developed by : Malhar Vora Developed on : 20/07/2010 Email : vbmade2000@gmail.com Web Site : http://malhar2010.blogspot.com ****************************************************************************/ #includeshort prime(int no) { if(no % 2==0) return 0; else return 1; } void main() { int no; printf("Enter a no :"); scanf("%d",&no); if(prime(no)==1) { printf("\nNo is prime"); } else { printf("\nNo is not prime"); } }
Thursday, July 22, 2010
Function to check that no is prime or not ( GTU Sem I Program No : 30)
Labels:
C,
GTU Programs
Subscribe to:
Post Comments (Atom)
tech blog
ReplyDeleteToday’s blogs offer everything from serious investigative journalism to silly photos, and they’re created by everyone from talented amateurs to staffers at some of the world’s largest media companies.