Test showing failed but output showing correct | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Test showing failed but output showing correct

I am solving Sololearn practice code That's odd I got the the output but test showing failed #include <stdio.h> int main() { int N,ar[20],i,sum=0; printf("An integer that represents the sum of only the even numbers in the list.\n"); scanf("%d",&N); for(i=0;i<N;i++) { scanf ("%d",&ar[i]); if(ar[i]%2==0) sum=sum+ar[i]; else continue ; } printf ("%d",sum); return 0; } Using C Could u pls help me https://code.sololearn.com/crefzKokWZ5C/?ref=app

9th Aug 2022, 4:34 AM
Kevin
2 Answers
+ 3
When solving code coach task, do not output anything except what was specified in the task. Your code prints a little note - "An integer that represents ..." which is not a part of the task requirement of output. Remove line 7 and try again. P.S. And please tag only names of languages relevant with the attached code (C language)
9th Aug 2022, 5:03 AM
Ipang
+ 1
If you are solving the practice code, then follow sample output, and Don't add anything except the final result...
9th Aug 2022, 5:02 AM
Pallavi Jha
Pallavi Jha - avatar