Pages

Monday, January 2, 2012

C Programming to decide if the number is positive or negative


/*To decide if the number is positive, negative or 0*/
#include<stdio.h>
#include<stdlib.h>
int main( )
{
    int num;
    printf ("enter number: ");
    scanf ("%d",&num);
    if (num>0)
       printf ("%d is positive",num);
    else
        printf ("%d is negative or zero",num);
    system ("pause");
    return 0;
}

No comments:

Post a Comment