I want the user to choose 5 options like you can see in the switch below in my code, but I have 39 errors and I can not see one of them!
Well i post the code here, i will continue to work on it but if you can show me my error that will give me a lot for my knowledge.
Thx You in advance!!!!!!!!
Code:#include <iostream.h> #include <conio.h> int x; int y; int addit(int x, int y); int soust(int x, int y); int multi(int x, int y); int divide(int x, int y); int exit(int x, int y); int main() { int input; cout<<"1. "Add function"<<endl; cout<<"2. "Soustract function"<<endl; cout<<"3. "Multi function"<<endl; cout<<"4. "Divide function"<<endl; cout<<"5. "Exit"<<endl; cin>>input; cout<<"First number"<<endl; cin>>x; cout<<"Second number"<<endl; cin>>y; switch (input) { case 1: addit(); addit(x,y); cout<<addit(x,y); break; case 2: soust(); soust(x,y); cout<<soust(x,y); break; case 3: multi(); mutli(x,y); break; case 4: divide(); divide(x,y); cout<<divide(x,y); break; case 5: Exit(); return 0; break; default: cout<<"Error, bad input, quitting"); } return 0; } int addit(int x,int y) { return x+y; } int soust(int x,int y) { return x-y; } int multi(int x,int y) { return x*y; } int divide(int x,int y) { return x/y; }




Reply With Quote