Pages

Wednesday, March 26, 2014

C Program to demonstrate If Else Statement

/*example of if else statement*/
#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