C program to check whether a number is positive or negative
belongs to collection: C programs - Basic C Programs
All Answers
total answers (1)
Severity: 8192
Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
Filename: libraries/Filtered_db.php
Line Number: 23
belongs to collection: C programs - Basic C Programs
total answers (1)
C program to check whether a number is positive or negative - Source code
Program Output
Program Explanation
1. The first if statement checks whether the number is greater than 0 or not. If true, it prints the output on the screen.
2. The second statement, else if statement, checks if the number is less than than 0 and if true, the block inside it executes.
3. At last, if neither the entered number is greater than 0 nor less than 0, then it is obvious that it is 0. In such case, the last else block gets executed.
need an explanation for this answer? contact us directly to get an explanation for this answer