Friday 20 March 2015

Prime Number or Not




 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
#include<stdio.h>
void main()
{
 int n;
 printf("Please enter any number: ");
 scanf("%d", &n);
  for(int i=n-1;i>1;i--)
  {
   if(n%i==0)
   {
    printf("its not a prime number\n");goto level;
   }
  }
 printf("its a prime number\n");       
 level:
 printf("finish.....\n");
}

0 comments:

Post a Comment

 

Subscribe to our Newsletter

Contact our Support

Through the contact form

Our Team Memebers