Advertisement
Guest User

HELP ME

a guest
Jul 13th, 2014
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.06 KB | None | 0 0
  1. The else statement is showing up as an error and i did't do anything wrong i dont think. Any help would be great!:
  2.  
  3.  
  4.  
  5.  
  6.  
  7. #include <iostream>
  8.  
  9.  
  10. using namespace std;
  11.  
  12.  
  13.  
  14. int main()
  15. {
  16.        int a;
  17.        int b;
  18.        int c;
  19.        int var;
  20.  
  21.        int sum;
  22.        cout << "Would you like Multiplication(1) or addition(0)";
  23.        cin >> var;
  24.    if(var == 1)
  25.      
  26.  
  27.  
  28.        cout << "Enter a number\n";
  29.        cin >> a;
  30.  
  31.        cout << "Enter Another Number\n";
  32.        cin >> b;
  33.  
  34.        cout << "One more!\n";
  35.        cin >> c;
  36.  
  37.  
  38.        sum = a * b * c;
  39.  
  40.        system("pause");
  41.        return 0;
  42.        else
  43.        {      
  44.      
  45.                cout << "Enter a number\n";
  46.                cin >> a;
  47.                cout << "Enter Another Number\n";
  48.                cin >> b;
  49.                cout << "One more!\n";
  50.                cin >> c;
  51.                sum = a + b + c;
  52.                cout << "The sum is " << sum << endl;
  53.                system("pause");
  54.                return 0;
  55.  
  56.        }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement