Write a program that read any integer & test prime or not prime (2).

#include<stdio.h>
#include<conio.h>
#include<iostream.h>

void main()
{
    int n,p;
    clrscr();
    cout<<"Enter any number, n = ";
    cin>>n;

    if(n<2)
       p=0;
    else
    {
       p=1;
       for(i=2;i<n;i++)
          if(n%i==0)
             p=0;
    }
    if(p==1)
       cout<<n<<" is Prime number";
    else
       cout<<n<<" is not Prime number";

    getch();
}

///////////////////////////////////////////////////////////////////////////
Copy & paste this code in your TC & run, then you will get output.......
If you have any problem please comment below.........