Powered By Blogger

07 March 2017

WRITE A PROGRAM TO CHECK NUMBER IS +VE & -VE

INPUT--


#include<iostream>
using namespace std;

int main()
{
int a;
cout<<"Enter any non-zero Number : ";
cin>>a;
(a>0)?cout<<"Number is positive":cout<<"Number is negative";
return 0;
}


OUTPUT--

EXAMPLE--1-->
Enter any non-zero Number : 56
Number is positive

EXAMPLE--2-->
Enter any non-zero Number : -14
Number is negative

No comments:

Post a Comment