Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  prime
Language: C/C++
Code:
#include<stdio.h>
#include<conio.h>
void main()
{
  int a,i,f=0;
  clrscr();
  printf("enter a num");
  scanf("%d",&a);
  for(i=2;i<=a/2;i++)
  {
     if(a%i==0)
         f=1;
     else
         f=0;
   }
   if(f==1)
      printf("not prime");
    else
      printf("prime");
  }
  getch();
}
          
          
          
          
          
          
Comments: