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:";
        }
    }
}

Last edited by shabbir; 19Dec2008 at 14:16.. Reason: Code block