Write a program to check weather given number is prime or not
#include <stdio.h>
#include <conio.h>
int main()
{
int a, b, counter=0, num;
printf("Enter number: ");
scanf("%d", &num);
for(b=2; b<num; b++)
{
if ((num%b)==0)
{
counter++;
}
}
if(counter==0 && num!= 1)
{
printf("%d is a prime number.", num);
}
else
printf("%d is not a prime number.", num);
getch();
}