Alguien me dice que estoy haciendo mal? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Alguien me dice que estoy haciendo mal?

Haga lo que haga no me realiza las operaciones correctamente https://code.sololearn.com/cCmzJ2MdCjdr/?ref=app

16th Nov 2018, 9:42 PM
Antonio Pato Gonzalez
Antonio Pato Gonzalez - avatar
2 Answers
+ 2
Cool error int suma; suma=a+b; <-- calculate cout<<"primer valor\n"; cin>> a; <-- input assigned cout<<"segundo valor\n"; cin>>b; <-- input assigned You calculate suma before the input is assigned to the variables. int suma; // suma=a+b; cout<<"primer valor\n"; cin>> a; cout<<"segundo valor\n"; cin>>b; suma=a+b; //move the line to here
16th Nov 2018, 9:55 PM
sneeze
sneeze - avatar
+ 1
😁 gracias ... así me funciona
16th Nov 2018, 10:45 PM
Antonio Pato Gonzalez
Antonio Pato Gonzalez - avatar