programming-examples/c++/_Basic/Check Positive or Negative.cpp
2019-11-15 12:59:38 +01:00

20 lines
484 B
C++

#include <iostream.h>
#include<conio.h>
void main()
{
clrscr(); //clear screen
int number;
cout<< "Enter an integer: ";
cin>> number;
if ( number >= 0)
{
cout << "You entered a positive integer: "<<number<<endl;
}
else
{
cout<<"You entered a negative integer: "<<number<<endl;
}
cout<<"This statement is always executed because it's outside if...else statement.";
getch();
}