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...

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

how to take time as input in the format (12:02:13) from user so that controls remains between these columns?

1835


What output does this program generate as shown? Why? class A { A() { cout << "A::A()" << endl; } ~A() { cout << "A::~A()" << endl; throw "A::exception"; } }; class B { B() { cout << "B::B()" << endl; throw "B::exception"; } ~B() { cout << "B::~B()"; } }; int main(int, char**) { try { cout << "Entering try...catch block" << endl; A objectA; B objectB; cout << "Exiting try...catch block" << endl; } catch (char* ex) { cout << ex << endl; } return 0; }

593


Write a program that print in screen a tree with its height taken from user by entering number of 4 digits and find the odd numbers then calculate the sum of odd numbers so he get the height of tree?

2921


write a program that creates a sequenced array of numbers starting with 1 and alternately add 1 and then 2 to create the text number in the series , as shown below. 1,33,4,6,7,9,............147,148,150 Then , using a binary search , searches the array 100 times using randomly generated targets in the range of 1 to 150

3270


Implement a command console for changing settings on a particular object. The command console should allow you to enter a string and will return the response (very similar to a terminal session). The commands are as follows: SET propertyname=newvalue will change the target object’s member named “propertyname” to have a value equal to “newvalue”. If the input value is incompatible (i.e. an int being set to a string), print out an appropriate error message. GET propertyname will print out the current value of the target object’s member named “propertyname”. GET * will print out a list of all target object members and their current values. The system should be extensible for future commands and should accept an arbitrary object, such that another developer could insert another object into the system and rely on the command console to get and set the properties correctly.

3404






Write a C++ program without using any loop (if, for, while etc) to print prime numbers from 1 to 100 and 100 to 1 (Do not use 200 print statements!!!)

3282


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

1802


How to Split Strings with Regex in Managed C++ Applications?

3138


Code for Two Classes for Doing Gzip in Memory?

2818


Code for Small C++ Class to Transform Any Static Control into a Hyperlink Control?

2569


1+1/2!+1/3!+...+1/n!

1952


Write a C/C++ program that connects to a MySQL server and displays the global TIMEZONE.

4579


write a program using 2 D that searches a number and display the number of items 12 inputs values input 15,20, 13, 30, 38, 40,16, 18, 20 ,18 ,20 enter no. to search : 20

3372


write a program that reads a series of strings and prints only those strings begging with letter "b"

2677


Code for Easily Using Hash Table?

2400