Write a C Program check whether given number is positive, negative or zero. - Pratik Ghelani

Pratik Ghelani

Breaking

Friday, January 11, 2019

Write a C Program check whether given number is positive, negative or zero.

Program:-

#include <stdio.h>
void main()
{
    double a;

    printf("Enter a number: ");
    scanf("%lf", &a);
    if (a < 0.0)
        printf("You entered number is negative number.");
    else if (a > 0.0)
        printf("You entered number is  positive number.");
    else
        printf("You entered number is Zero number.");


}

Output:-






No comments:

Post a Comment