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.
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.
+ 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.
0
Write a program that takes two numbers as input, assigns those values to the provided a and b variables, then outputs their sum.