From f931ffb3ea2536c862fe075b04d5a8cd1f09df96 Mon Sep 17 00:00:00 2001 From: Sarv8Dakhane <37911852+sarveshdakhane@users.noreply.github.com> Date: Fri, 2 Oct 2020 10:05:28 +0530 Subject: [PATCH] Tried sum of odd number in array --- main.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/main.cpp b/main.cpp index f439d60..973a3ea 100644 --- a/main.cpp +++ b/main.cpp @@ -142,17 +142,14 @@ string first_and_second(int arr[], int n) { string count_and_sum(int arr[], int n) { - /** - TODO: write a function to count the odd number inside an array and sum the even number. Return the result as string - arr : input array - n : number of element inside array - */ - - // YOUR CODES HERE - //----------------------- - - - //----------------------- + int i,oddSum=0; + for(i=0; i