C Programs

Write a C program which checks primary number?


/*  C Program Which Checks Primary Number */
#include <stdio.h>
#include <conio.h>
int main()
{
       int i,num,count;
       clrscr();
       printf("Enter Number : ");
       scanf("%d",&num);
       for(i=1;i<=num;i++){
              if(num % i == 0){
                    count++;
              }
       }
       if(count == 2){
            printf("Given number is primary number");
       }
       getch();
       return 0;
}

www.000webhost.com