__Problem:__Check whether the entered integer is negative, positive or zero.

__Algorithm:__1. Prompt for the number.

2. Decide whether it is zero, greater than zero or less than zero.

3. Display the result.

__Source Code:__#include<iostream>

#include<conio.h>

using namespace::std;

int main(void)

{

int num;

cout<<"Enter the number: ";

cin>>num;

//Deciding whether number is positive, negative or zero

if(num<0)

cout<<"Given number is negative"<<endl;

else if(num==0)

cout<<"Given number is zero"<<endl;

else if(num>0)

cout<<"Given number is positive"<<endl;

getch();

return 0;

}

Simple enough! There is only a decision to make in this program...

## 0 response(s):

## Respond to this Post

Your participation is appriciated...