1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168
|
#include <iostream>
#include <conio.h>
#include <stdio.h>
using namespace std;
int main()
{
int choice;
start:
cout <<"Choose Option";
cin>>choice;
//option 1
if (choice ==1)
{
int number1, number2, number3;
system ("cls");
cout << "OPTION 1/n/n/n";
int number1; // Declare number1 as an integer variable
int number2;
int number3
int result
int result1;
cout <<"Enter first number: ";
cin >> number1;
cout <<"Enter second number: ";
cin >> number2;
cout <<"Enter third number ";
cin >> number3
result = number1 + number2 + number3
cout << "Result" << number1 << "add" << number2 << "add" << number3
<< "is" << result << endl;
if (choice == 2)
{
int number1, number2, number3 ,result;
cout <<"Enter first number: ";
cin >> number1;
cout <<"Enter second number: ";
cin >> number2;
cout <<"Enter third number ";
cin >> number3
result = number1 - number2 / number3
cout << "Result" << number1 << "subtract" << number2 << "divide" << number3
<< "is" << sum << endl;
system ("cls");
cout << "OPTION 2";
{
if (choice == 3)
{
int number1, number2, number3, result, result1;
cout <<"Enter first number: ";
cin >> number1;
cout <<"Enter second number: ";
cin >> number2;
cout <<"Enter third number ";
cin >> number3
result = number1 - number2
result1 = result - number3
if(result > result1)
cout << "Result" << number1 << "and" << number2 << "and" << number3
<< "is" << result << endl;
system ("cls");
cout << "OPTION 3";
{
int number1, number2, number3, result;
if (choice == 4)
{
int number1, number2, number3, result;
cout <<"Enter first number: ";
cin >> number1;
cout <<"Enter second number: ";
cin >> number2;
cout <<"Enter third number ";
cin >> number3
if(number1 > number2)
{
cout << "number1 is Higher" << endl;
if(number1 < number2)
cout << "number 2 is Higher"
if(number1 > number3)
cout << "number1 is Higher"
if(number3 > number1)
cout <<"number3 is higher"
}int highest_number=10;
int input_number;
cin >> input_number;
if(input_number > highest_number)
{
cout << " highest number." << endl;
highest_number = input_number;
}
if(input_number <= highest_number)
{
cout << "Number is not the highest." << endl;
if(number1 < number2 > number3)
cout << "Result" << number1 << "and" << number2 << "and" << number3
<< "is" << result << endl;
system ("cls");
cout << "OPTION 4";
{
if (choice == 5)
{
int number1, number2, number3, result;
system ("cls");
cout << "OPTION 5\n";
return 0;
}
//SELECTION ERROR
if ((choice > 5) || (choice < 1))
{
system("cls");
cout << "\n\nERROR. PLEASE SELECT 1 - 5 ONLY.";
cout << "\n\n\n\nPress a key to return to selection menu...";
_getch();
goto start;
}
}
|