Demonstrate IF...ELSE statement - C++ Statement

C++ examples for Statement:if

Description

Demonstrate IF...ELSE statement

Demo Code

#include <iostream>
using namespace std;
int main()/*  w  w w  .  j ava 2s  .  c o  m*/
{
   int x;
   cout << "\nEnter a number: ";
   cin >> x;
   if( x > 100 )
      cout << "That number is greater than 100\n";
   else
      cout << "That number is not greater than 100\n";
   return 0;
}

Related Tutorials