+ 1
Why I did not see the msg "Enter a number" in my screen???
I only see a new small windows "Seems that your program requires input"... Where is the msg "Enter a number"???? What is wrong???
3 Antworten
+ 3
That small window is shown when Code Playground detects that your code requires input, depending on the number of input required, you will have to enter your inputs on that dialog, each input is separated by a new line (Enter), in your case there's two input (as numbers) required, so you enter two numbers, as follows:
4
5
Then the code will be processed, in this case a process of adding a and b, and on success, the output will be shown, whereas on error the error message will be shown instead.
Hth, cmiiw
+ 1
Is Code Playground. I know Python doesn't display a message here. Maybe c++ neither.
But the message is displayed in html :(
+ 1
oh! it is c++ and this is the code (from the course):
#include <iostream>
using namespace std;
int main()
{
int a, b;
int sum;
cout << "Enter a number \n";
cin >> a;
cout << "Enter another number \n";
cin >> b;
sum = a + b;
cout << "Sum is: " << sum << endl;
return 0;
}
Thank you!