Code coach [That's odd] | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Code coach [That's odd]

Task 4 and 5 failed!! Can anyone tell me what's wrong with my code ? https://code.sololearn.com/cCSOpek3TC55/?ref=app

31st May 2020, 2:03 PM
Samir_Shah
Samir_Shah - avatar
7 Answers
+ 6
#include <iostream> using namespace std; int main() { int x; int n; int sum=0; for(int i=0;i<=n;i++) { cin>>x; if(x%2==0) sum=sum+x; } cout<<sum; return 0; } Friend I hope this will help u with u r code to solve problem
31st May 2020, 2:06 PM
ツSampriya😘ツ
ツSampriya😘ツ - avatar
+ 3
The Crazy Programmer you need to give a hint Becoz practice makes man better
2nd Jun 2020, 8:43 AM
Coder
Coder - avatar
+ 1
Samir_Shah Right. But The Crazy Programmer has give you a hint, not the ready solution.
31st May 2020, 2:51 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 1
Kuba Siekierzyński 😂😂😂
31st May 2020, 2:55 PM
ツSampriya😘ツ
ツSampriya😘ツ - avatar
0
But input should be a list of numbers And we need to find the sum of even numbers
31st May 2020, 2:12 PM
Samir_Shah
Samir_Shah - avatar
0
Thanks 😊
1st Jun 2020, 8:48 AM
Samir_Shah
Samir_Shah - avatar
0
Can we work with arrays
5th Mar 2022, 3:41 PM
Larbi