i have just trying codeing in HackerRank and there is something wrong | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

i have just trying codeing in HackerRank and there is something wrong

Task Read 3 numbers from stdin and print their sum to stdout. Note: If you plan on completing this challenge in C instead of C++, you'll need to use format specifiers with printf and scanf. Input Format A single line containing 3 space-separated integers:a ,b , and c. Constraints 1<=a,b,c<=1000 Output Format Print the sum of the three numbers on a single line. Sample Input 1 2 7 Sample Output 10 Explanation The sum of the three numbers is . C++ and my code is https://onlinegdb.com/BJJheCr2B

22nd Nov 2019, 9:21 PM
Mahmoud Hamed
Mahmoud Hamed - avatar
12 Answers
+ 3
Try this- int a,b,c; cin>>a>>b>>c; cout<<a+b+c;
22nd Nov 2019, 9:30 PM
Avinesh
Avinesh - avatar
+ 2
there is still something wrong
22nd Nov 2019, 9:33 PM
Mahmoud Hamed
Mahmoud Hamed - avatar
+ 1
done but unfortunately there is something wrong
22nd Nov 2019, 9:35 PM
Mahmoud Hamed
Mahmoud Hamed - avatar
+ 1
thank U bro i did it , the wrong was in writing cout inter the first number the othere cout and I don't know why
22nd Nov 2019, 9:42 PM
Mahmoud Hamed
Mahmoud Hamed - avatar
+ 1
Mahmoud Hamed On such coding platforms always remember to code just what you are asked. Do not enter anything extra like you did with your current code. Just give them the numbers they want, that's it.
22nd Nov 2019, 9:45 PM
Avinesh
Avinesh - avatar
+ 1
could you tell me some websites like HackerRank to solve problems in but i want it for beginners as i know just a little
22nd Nov 2019, 9:47 PM
Mahmoud Hamed
Mahmoud Hamed - avatar
+ 1
Avinesh thank you alot for your help
22nd Nov 2019, 9:55 PM
Mahmoud Hamed
Mahmoud Hamed - avatar
+ 1
Mahmoud Hamed you're welcome
22nd Nov 2019, 9:56 PM
Avinesh
Avinesh - avatar
+ 1
hackerearth and edabit are great places for practice as well.
23rd Nov 2019, 2:13 AM
Tony
Tony - avatar
0
Can you update the link with your new code?
22nd Nov 2019, 9:36 PM
Avinesh
Avinesh - avatar
- 1
Why is there return main(); at the end? Kindly make it return 0;
22nd Nov 2019, 9:34 PM
Avinesh
Avinesh - avatar