By using this site, you agree to our Privacy Policy and our Terms of Use. Close

I know it's already fixed and you got it working, but add

cout<<"el resultado de "<<a<<" "<<b<<" = " <<r<< endl;

to get a line break, else you'll mess up the prompt if you run it in command line....plus it'll look nicer and your teacher will like you more