163k views
25 votes
Please help me please help me​

Please help me please help me​-example-1

1 Answer

13 votes

Step-by-step explanation:

in C++

#include<iostream.h>

#using namespace std;

main()

{

int array[8];

int oddSum=0;

for(int i=0; i<8;i++)

{

if(array[i]%2==1)

{

oddSum=oddSum+array[i];

}

else()

{ //do nothing }

}

cout<<"The sum of odd numbers are:"<<oddSum;

getch();

return 0;

}

User Dimon Buzz
by
3.2k points