Ads Top

NEGATIVE OR POSITIVE NUMBER

NEGATIVE OR POSITIVE NUMBER


#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a;
cout<<"enter the numbers";
cin>>a;
if(a>0)
cout<<a<<"is positive";
else
cout<<a<<"is negative";

getch();
}

OUTPUT:
Enter the number:
8
8 is positive.

No comments:

Touchfeeds. Powered by Blogger.