Author Topic: IF-ELSE Decision Structure  (Read 2546 times)

louiecerv

  • Moderator
  • User
  • *****
  • Posts: 85
IF-ELSE Decision Structure
« on: November 22, 2005, 01:13:27 AM »
Demo code:
Code: [Select]

#include <iostream>

using namespace std;

int main()
{
    //demonstrate IF-ELSE decision structure
    cout << "-- PROGRAM TO DEMONSTRATE IF-ELSE --" << endl;
    cout << "What is your favorite number?  ";
    int favNum;
    cin >> favNum;
   
    if (favNum <= 10)
    {
       cout << "The value is just right" << endl;
    } else {
       cout << "The value is too high" << endl;
    }

    system("PAUSE");
    return 0;
}
Analyze. Design. Develop. Debug. Deploy. Maintain.