Follow This Blog For more... 😊

Program to accept a number and check whether the number is Positive, Negative or Zero.| Using C language| very Basic| C Program series 09|

👨‍💻C Program to accept numbers and check whether the number is Positive, Negative, or Zero.

Code:


    //Program to accept a number and check whether the number is Positive, Negative, or Zero.

    #include<stdio.h>
    main()
    {
        int number;
       
        printf("Program to accept a number and check whether the number is Positive, Negative or Zero.\n");
       
        printf("Enter the number:");
        scanf("%d",&number);
       
       
        if(number<0)
        {
            printf("%d is NEGATIVE.",number);
        }
        else if(number>0)
        {
            printf("%d is POSITIVE.",number);
        }
        else
        {
            printf("%d is ZERO.",number);
        }
    }

Output:



👉Click for more C Program series Questions. [Questions list]

Comments

Popular Posts