GTU PPS Program - 8

8. Write a C program to find that the accepted number is Negative, or Positive or Zero.

#include<stdio.h>
#include<conio.h>
int main()
{
    int num;
    printf("\nEnter any number : ");
    scanf("%d",&num);
    if(num==0)
        printf("\nyou entered Zero");
    else if(num>0)
        printf("\nEntered number is Positive");
    else if(num<0)
        printf("\nEntered number is Negative");
    else
        printf("\n Enter valid number");
    getch();
    return 0;
}

Sample output

Comments

YouTube

Popular posts from this blog

GTU PPS Program - 15

PPS Program - 22

JavaFX Day - 1