Ternary operator

Description:

write a program to find a number as positive or negative using ternary operator Test Case 1 Input (stdin) 5 Expected Output Number is positive Test Case 2 Input (stdin) -2 Expected Output Number is negative

Program :

#include <iostream>

using namespace std;

int main()

{

  int a;

  cin>>a;

  if ( a > 0)

    cout<<"Number is positive";

  else

    cout<<"Number is negative";

return 0;

}