Write a program to enter 10 number of integer entries into
an array n and then odds up all the odd entries. the program
then displays the result.
plssss answer assss fast asss u can...



Write a program to enter 10 number of integer entries into an array n and then odds up all the odd ..

Answer / avk

I didn't mention in which programing Language U need this so
I wrote in 'C'. I hope U will understand

#include<stdio.h>
#include<conio.h>
void main()
{
int n[i],i,sum=0;
clrscr();
for(i=0;i<10;i++)
{
scanf("%d",&n[i]);
if(n[i]%2==0)
continue;
else
sum+=n[i];
}
printf("Total Of Odd Numbers %d",sum);
getch();
}

Is This Answer Correct ?    32 Yes 19 No

Post New Answer

More C++ Code Interview Questions

can we declare an object of a class in another class?(assume both class as public classes)

1 Answers   Microsoft,


Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.

0 Answers  


i don't know about working of nested for loop can any one help me

0 Answers  


find level of following tree (state, parent) " J,D I,D H,C E,B F,B G,C B,A D,A C,A A,& K,E L,E L,F M,F N,G O,H P,I P,H Q,I R,J S,K U,P T,L

0 Answers  


Code for Method of Handling Factorials of Any Size?

0 Answers  






how to find out the maximum number out of the three inputs.

6 Answers   ABC, Apple, C3I, HP, TCS,


program to find the magic square using array

1 Answers  


Show by induction that 2n > n2, for all n > 4.

2 Answers   Karvy, Qatar University,


what is the diffrence between ++x , x++ pleaaaaase ???

7 Answers  


Min-Max Write an algorithm that finds both the smallest and largest numbers in a list of n numbers and with complexity T(n) is at most about (1.5)n comparisons.

10 Answers   ABC, College School Exams Tests, ITC Infotech, Kyambogo University, Qatar University,


write a program that accepts a number and outputs its equivalent in words. take note that the maximum input is 3000

1 Answers   Alvin,


a program using one dimensional array that searches a number if it is found on the list of given input numbers given by the user and locate its exact location in the list.. ""EXAMPLE"" enter how many numbers to be inputted: 5 12 14 11 09 30 what number to search: 11 11 IS FOUND IN LOCATION 3 PLZZZ.. ELP ME...

3 Answers  


Categories