WAP in C++ to input any number and to print whether the number is positive, negative or zero.
➡️ Wrong Answer will be reported
Share
WAP in C++ to input any number and to print whether the number is positive, negative or zero.
➡️ Wrong Answer will be reported
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Verified answer
Given:
________________________
Logic Used:-
If n<0 Number is Negative .
if n>0 Number is positive.
else Number is 0.
________________________
Code:
________________________
Test 1→
Input:
Enter the number to be checked
46
Output:
46 is a positive number
Test 2→
Input:
Enter the number to be checked
-46
Output:
-46 is a negative number