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>
    int prime(int n)
    {
    int status;
    for(int i=2;i<n;i++)
    {
    if(n%i==0)
    {
    status=0;
    break;
    }
status=1;
    }
    if(status==1)
    printf("n%d is a prime number,n");
    }
    int main()
    {
    int n;
    printf("Prime numbern");
    printf("nEnter a number");
    scanf("%d",&n);
    getch();     
}
          
          
Comments: