News:

MyKidsDiary.in :: Capture your kids magical moment and create your Online Private Diary for your kids

Main Menu

[C++] if/else project

Started by sajiv, May 06, 2009, 01:30 PM

Previous topic - Next topic

sajiv

[C++] if/else project

#include <iostream?
using namespace std;

int main()
{
      int iNumber;
      int iAnswer = 5;
      cout << "enter a number between 1 - 10 and i will tell you if it is right or wrong" << endl;
      cin >> iNumber;
      if (iNumber == iAnswer)
            cout << "Correct! Well Done!" << endl;
      else
            cout << "Incorrect! Please try again!" << endl;
      return 0;
}