+ 4

How will I solve the problem occur before running a program

Whenever I run a program there always ask for "looks like your program needs output"

10th Jul 2020, 8:56 AM
Navneet Kaur💫
Navneet Kaur💫 - avatar
14 Respuestas
+ 2
It's not an error, code playground need to be provided with input beforehand. Just have a look at this code for detailed information about the same👇 https://code.sololearn.com/WhiNb9BkJUVC/?ref=app
10th Jul 2020, 8:59 AM
Arsenic
Arsenic - avatar
+ 7
Navneet can you paste your code here..
10th Jul 2020, 8:59 AM
Aditya
Aditya - avatar
+ 7
As Arsenic said your program needs input..try by putting any values e.g. 34 56 66 it will give the output :)
10th Jul 2020, 9:02 AM
Aditya
Aditya - avatar
+ 6
Navneet no it gives output.. your input format is incorrect..it works in my phone...
10th Jul 2020, 9:04 AM
Aditya
Aditya - avatar
+ 6
Navneet it's the input format made by the developer.. for taking input from user..but I also don't know the reason why they have made such format for input.. you can kindly ask the developer 😅
10th Jul 2020, 9:14 AM
Aditya
Aditya - avatar
+ 5
Navneet no it's not possible.. it gives exact output.. try once again 👍
10th Jul 2020, 9:08 AM
Aditya
Aditya - avatar
+ 3
Aditya see please
10th Jul 2020, 9:01 AM
Navneet Kaur💫
Navneet Kaur💫 - avatar
+ 3
Because your program needs user input.. In your program you are asking input from user side. When you do not take input from user then this message(looks like your program need input) will not show.
10th Jul 2020, 11:46 AM
Ruchi Priyamvada
Ruchi Priyamvada - avatar
10th Jul 2020, 9:00 AM
Navneet Kaur💫
Navneet Kaur💫 - avatar
+ 2
Aditya and it does not show any output and does not take values from user
10th Jul 2020, 9:03 AM
Navneet Kaur💫
Navneet Kaur💫 - avatar
+ 2
Aditya and Arsenic I've done soo but it does not show correct sum
10th Jul 2020, 9:06 AM
Navneet Kaur💫
Navneet Kaur💫 - avatar
+ 2
Navneet your program is working fine, just like Aditya said you might not be entering the input correctly. Just run the program I have provided with my first answer to get a clear understanding of how input is handled in sololearn.
10th Jul 2020, 9:11 AM
Arsenic
Arsenic - avatar
+ 2
You are using "cin" in your program which means your program is expecting user to input some value. That's why sololearn is prompting you that "looks like your program need input". You have to enter all the inputs seperated by a space/newline character before the execution of your program.
10th Jul 2020, 9:18 AM
Arsenic
Arsenic - avatar
+ 1
Aditya first just tell me why it ask for "looks like your program needs output"
10th Jul 2020, 9:10 AM
Navneet Kaur💫
Navneet Kaur💫 - avatar