Search Results

Search found 1 results on 1 pages for 'user2975402'.

Page 1/1 | 1 

  • error_expected_primary expression before in. In functions

    - by user2975402
    Here is my code. I try to fix it and I always obtain the same error: expected primary expression before 'int'. in line 47, 55, 63, 80, 86. And I've already tried this program in small pieces before and it works. It doesn't marked that error. ` #include using namespace std; int add (int a, int b) { int r; r=a+b; return (r); } int ssub (int a, int b) { int r; r=a-b; return (r); } int mult(int a, int b) { int r; r=a*b; return (r); } int menu(int a, int b){ int r; char x; cout <<"What do you want to do: \na.Adding \n s. Substract \n m. Multiply. \n. e. Exit"<<endl; cin>>x; switch (x){ case 'a': cout << "Give a value for a"<<endl; cin>>a; cout <<"Give a value for b"<<endl; cin>>b; add (int a, int b); //aquí y en otras líneas me sale: expected primary expression before int. break; case 's': cout << "Give a value for a"<<endl; cin>>a; cout <<"Give a value for b"<<endl; cin>>b; ssub (int a, int b); break; case 'm': cout << "Give a value for a"<<endl; cin>>a; cout <<"Give a value for b"<<endl; cin>>b; mult (int a, int b); break; case 'e': x='e'; break; default: cout<<"Wrong choice. Run the program again and choose another letter"<<endl; break; } return r; } cout<<"The result is " << menu (int a, int b)<<endl; int main() { menu (int a, int b); return 0; } `

    Read the article

1