0

6.1 c++

#include <iostream> using namespace std; int main() { int a; int b; int sum; // your code goes here cout << "Enter a number \n"; cin >> a; cout << "A is " << a << endl; cout << "Enter another number \n"; cin >> b; cout << "B is " << b << endl; sum = a + b; cout << "A + B is "<< sum << endl; return 0; } Is there something wrong with my code? I don’t understand why it won’t let me submit my answer.

14th Jan 2022, 10:43 PM
Phillipe John Jules
Phillipe John Jules - avatar
3 Réponses
+ 5
Your output should be same as expected output means your code needs to print only sum. You can remove/comment the unnecessary outputs.
15th Jan 2022, 1:39 AM
Simba
Simba - avatar
+ 2
What's the meaning of "it won't let me submit my answer"? In code playground, for you to input multiple values, you have to input all at once, putting each one in a separated line.
15th Jan 2022, 12:36 AM
Emerson Prado
Emerson Prado - avatar
0
Write a program that takes two numbers as input, assigns those values to the provided a and b variables, then outputs their sum.
14th Jan 2022, 10:46 PM
Phillipe John Jules
Phillipe John Jules - avatar