Prerequisite:
Signed Number: if(number is greater than or equal to zero) then number is positive otherwise negative
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
#include<stdio.h> int main() { long double Number; printf("\n Program to check Whether Number is Positive or not"); printf("\nPlease enter any Number: "); scanf("%Lf",&Number); if(Number>0.00) { printf("\nNumber %Lf is a positive Number",Number); } else { printf("\nNumber %Lf is a negative Number",Number); } return 0; } |
1 2 3 4 5 |
Output: Program to check Whether Number is Positive or not Please enter any Number: -2435.345 Number -2435.345000 is a negative Number |