Write a programin c++ p that accepts a number from the user and find whether the number is negative, positive or zero.
Answers
Answered by
0
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<math.h>
void main ()
{
clrscr();
int n;
cout<<"Enter the number :";
cin>>n;
if(n >= 1)
cout<<"\n The number is positive";
else if(n <= -1)
cout<<"\n The number is negative ";
else
cout<<" \n The number is 0 ";
getch();
}
#include<conio.h>
#include<stdio.h>
#include<math.h>
void main ()
{
clrscr();
int n;
cout<<"Enter the number :";
cin>>n;
if(n >= 1)
cout<<"\n The number is positive";
else if(n <= -1)
cout<<"\n The number is negative ";
else
cout<<" \n The number is 0 ";
getch();
}
Similar questions