123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
#include <iostream> using namespace std; int main() { char a; int value = 1; int x; int sum; sum = 0; cout << "a: Addition \nb: Subtraction" << endl; cin >> a; if(a == 'a'){ cout << "enter 5 digits" << endl; while (value <= 5){ cin >> x; sum = x + sum; value = value ++; } cout << "Your answer is " << sum; } int subtractiona; int subtractionb; int difference; if(a == 'b'){ cout << "enter 5 digits" << endl; cin >> subtractiona; while (value <= 4){ cin >> subtractionb; difference = subtractiona - subtractionb; difference = subtractiona; value++; } cout << "Your answer is " << difference; } return 0; }