2/21/2009

C Program To Check Whether The Given Number Is +ve Or -ve



    /*Write a c program to check whether
       the given number is +ve or -ve */
#include <stdio.h>
#include <stdlib.h>

int main()
{
    int n ;
    printf("Enter the number:\n");
        scanf("%d",&n);
    if(n>=0)
     printf("%d is a positive number.\n", n);
    else
     printf("%d is negative number",n);
    return 0;
}
Out Put:
Enter the number:
23
23 is a positive number.

No comments:

Post a Comment