5 AnswersNew Answer
#include <stdio.h> #include <stdlib.h> int main() { int len, i; int sum = 0; int *arr; scanf("%d", &len); arr = (int*) malloc(len * sizeof(int)); for(i=0; i < len; i++) { scanf("%d", arr+i); if(*(arr+i)%2 == 0){ sum += *(arr+1); } } printf("%d", sum); free(arr); return 0; }
7/28/2020 3:26:51 AM💞Çútè Çõdêr💞
5 AnswersNew Answer
Ipang I suppose he is talking about the "That's odd..." challenge where one have to find the sum of all even integers present in a list of given length N. Let me know if you want all code coach tasks. Vígñësh [email protected]âdīyå Please remember to provide the challenge name or link next time if you want to get fast an accurate help. You have a tiny mistake: sum += *(arr+1); should be: sum += *(arr + i ); You already solved the task in other languages so it's probably a typo.
Kevin ★ Thanks bro for help
Ipang 😅 Vígñësh [email protected]âdīyå You're welcome.
What was the task requirement? is this one of the code coaches? I can't view code coaches BTW, so I need to know the task ...
Learn Playing. Play Learning
SoloLearn Inc.4 Embarcadero Center, Suite 1455