Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  prime
Language: C/C++
Code:
#include <stdio.h>
int main()
{
    int n,i,flag=0;
    printf("enter the number");
    scanf("%d",&n);
    for(i=2;i<n/2;i++)
    {
        if(i%2==0)
        {
            flag=1;
            break;
        
        }
    }
    if(flag==1)
    printf("not a prime number");
    else
    printf("prime number");
    return(0);
}

          
Comments: