create a c++ program that will ask 10 numbers and display
their sum using array.



create a c++ program that will ask 10 numbers and display their sum using array. ..

Answer / sneha shahade

#include<conio.h>
#include<iostream.h>
void main()
{
int a[10],i,s=0;
cout<<"enter 10 numbers";
for(i=0;i<10;i++)//loop to get 10 no. in array
cin>>a[i];
for(i=0;i<10;i++)//loop to find sum of 10 no.
s=s+a[i];
cout<<"sum is:"<<s;//display sum
getch();
}

Is This Answer Correct ?    9 Yes 0 No

Post New Answer

More OOPS Interview Questions

How to reverse a sentence in c program ex: ram is a good boy answer: boy good a is ram

0 Answers   IBM,


Given two strings like x=?hello? and y=?open?, remove any character from string x which is also used in string y, thus making the result x=?hll?.

13 Answers   IBM,


What is destructor in oop?

0 Answers  


What is namespace?

15 Answers  


What is the use of oops?

0 Answers  






what is the difference between function template and template of function?explain with example.

2 Answers  


What is difference between polymorphism and inheritance?

0 Answers  


what is difference b/w object based and object oriented programming language?

18 Answers   Chaitanya, College School Exams Tests, Educomp, IBM, Infosys, Telko,


Why do we use encapsulation in oops?

0 Answers  


Can we have a private virtual method ?

8 Answers   Ness Technologies,


The company is a fake company asking for money of RS10000 while training and not offering a job after training. My humble request to you people not to attend Astersys interview

1 Answers   Astersys,


What is static in oop?

0 Answers  


Categories