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.
Answer:
class num
{
public static void main( int a)
{
if(a>0)
System.out. println(" Num is positive ");
else if(a<0)
System.out.println ("Num is negative ");
else
System.out.println("Num is zero");
}}
Hope it helps pls mark it as brainliest and follow me...
Question:-
Code:-
#include <iostream>
using namespace std;
int main()
{
signed long n = 0;
cout << " Input a number : ";
cin >> n;
if(n> 0)
cout << " The entered number is positive.";
else if(n< 0)
cout << " The entered number is negative.";
else
std::cout << " The number is zero.";
return 0;
}