Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Help and Support (http://www.go4expert.com/community/help-and-support/)
-   -   Infraction for skp819: Code blocks (http://www.go4expert.com/community/infraction-skp819-code-blocks-t15548/)

shabbir 19Dec2008 14:18

Infraction for skp819: Code blocks
 
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:";
        }
    }
}




All times are GMT +5.5. The time now is 05:56.