WAP in C++ to input any number and to print whether the number is positive, negative or zero.
➡️ Wrong Answer will be reported
Answers
Answered by
1
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...
Answered by
2
Question:-
- Write a C++ program to input any number and print whether the number is positive, negative or zero.
Códe:-
#include <iostream>
using namespace std;
int main()
{
int 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
cout << " The number is zero.";
return 0;
}
Similar questions
Computer Science,
3 months ago
Math,
3 months ago
Math,
3 months ago
Social Sciences,
7 months ago
Science,
11 months ago
Physics,
11 months ago