# Answer to Question #47755 in C++ for arundhati

Question #47755

C++ program to print the sum of odd numbers in an array

Expert's answer

#include <iostream>

using namespace std;

//main method

int main()

{

//total number to input

int totalNumber=0;

//array of numbers

int numbers[100];

//promt user to enter "How many numbers do you want to enter"

cout<<"How many numbers do you want to enter?: ";

//read total Number

cin>>totalNumber;

for(int i=0;i<totalNumber;i++){

cout<<"Enter value: ";

cin>>numbers[i];

}

//check if velues in array is prime or not

for(int i=0;i<totalNumber;i++){

if(numbers[i]%2==1){

cout<<numbers[i]<<" is odd number.\n";

}

}

//delay

system("pause");

//exit program

return 0;

}

using namespace std;

//main method

int main()

{

//total number to input

int totalNumber=0;

//array of numbers

int numbers[100];

//promt user to enter "How many numbers do you want to enter"

cout<<"How many numbers do you want to enter?: ";

//read total Number

cin>>totalNumber;

for(int i=0;i<totalNumber;i++){

cout<<"Enter value: ";

cin>>numbers[i];

}

//check if velues in array is prime or not

for(int i=0;i<totalNumber;i++){

if(numbers[i]%2==1){

cout<<numbers[i]<<" is odd number.\n";

}

}

//delay

system("pause");

//exit program

return 0;

}

``

Need a fast expert's response?

Submit orderand get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

## Comments

## Leave a comment