Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  f
Language: C/C++
Code:
#include <iostream>
#include <Windows.h>

using namespace std;
int Number;

int main()
{
     system("COLOR B");
     SetConsoleTitle("Numbers");

     ioPoint:

     int Choice;
     cout << "1. New value, 2. Read current value, 3. Exit: ";
     cin >> Choice;

     switch (Choice)
     {
     case 1:
          cout << "Give new value: ";
          cin >> Number;
          system("CLS");
          cout << "New value has been set!" << endl;
          system("PAUSE");
          goto ioPoint;

     case 2:
          cout << "Current value is: " << Number << endl;
          system("PAUSE");
          goto ioPoint;
     case 3:
          cout << "Bye!" << endl;
          Sleep(300);

          return 0;
     default:
          cout << "Unknown case!" << endl;
          system("PAUSE");
          goto ioPoint;
     }
}
          
Comments: