Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //The else statement is showing up as an error and i did't do anything wrong i dont think. Any help would be great!:
- #include <iostream>
- using namespace std;
- int main()
- {
- int a;
- int b;
- int c;
- int var;
- int sum;
- cout << "Would you like Multiplication(1) or addition(0)";
- cin >> var;
- if(var == 1)
- cout << "Enter a number\n";
- cin >> a;
- cout << "Enter Another Number\n";
- cin >> b;
- cout << "One more!\n";
- cin >> c;
- sum = a * b * c;
- system("pause");
- return 0;
- else
- {
- cout << "Enter a number\n";
- cin >> a;
- cout << "Enter Another Number\n";
- cin >> b;
- cout << "One more!\n";
- cin >> c;
- sum = a + b + c;
- cout << "The sum is " << sum << endl;
- system("pause");
- return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement