Computer Science, asked by misscutie94, 7 months ago

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 8472
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 anindyaadhikari13
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