why i cant run my first program? tells split multiple strings | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

why i cant run my first program? tells split multiple strings

cant run program

16th Nov 2018, 1:49 PM
Hayko
Hayko - avatar
10 Answers
0
Well, it's just a number that is stored in a variable so that you can later work with it, right now it has no real 'meaning'. Variables: https://www.sololearn.com/learn/CPlusPlus/1606/ You should try going through the C++ course here on Sololearn if you want to learn more.
16th Nov 2018, 8:11 PM
Shadow
Shadow - avatar
+ 2
Without seeing your program, there is little we can do. How about linking the code here so we can see what you did?
16th Nov 2018, 1:53 PM
Shadow
Shadow - avatar
+ 1
#include <iostream> using namespace std; int main() { int n; cin>>n; return 0; }
16th Nov 2018, 3:34 PM
Hayko
Hayko - avatar
+ 1
Oh, that is just the input box of Sololearn. The line cin >> n; asks the user to enter a number, so you have to enter your input, in this case a number, when that box appears. Once you have submitted it, your program will run.
16th Nov 2018, 3:39 PM
Shadow
Shadow - avatar
0
looks like your program needs input split multiple inputs in sepperate lines
16th Nov 2018, 3:36 PM
Hayko
Hayko - avatar
0
compiler tells no output, i tried 1,2 and 3.
16th Nov 2018, 4:13 PM
Hayko
Hayko - avatar
0
Of course it does, there is no output statement in your code. If you want to display the number to the screen, add cout << n; after the input. https://www.sololearn.com/learn/CPlusPlus/1604/
16th Nov 2018, 8:01 PM
Shadow
Shadow - avatar
0
thank you very much, that worked :), but i dont understand what that number means
16th Nov 2018, 8:05 PM
Hayko
Hayko - avatar
0
thank you very much :)
16th Nov 2018, 8:14 PM
Hayko
Hayko - avatar
0
You're welcome, good luck with your studies!
16th Nov 2018, 8:16 PM
Shadow
Shadow - avatar