Post: Check if a number is prime or not
User: skp819
Infraction: Code blocks
Points: 1

Administrative Note:
Message to User:
Quote:
Learn to use BBCode in posts

Original Post:
Quote:
A simple program is here. to chech a number is prime or not.
Code:
void main()
{
    int a,b,i;
    cout<<"\n enter the no: ";
    cin>>a;
    for(i=2;i<=a;i++)
    {
        rem=a%i;
        if(rem==0)
        {
            cout<<"\nNo is not prime: ";    
        }
        else
        {
            cout<<"\nNo is  prime:";
        }
    }
}