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

Write a program in c++ to read two floating point numbers and find their sum and average.

2 Answers  


What is abstraction example?

1 Answers  


What is abstraction?

9 Answers  


What is solid in oops?

1 Answers  


What is oops with example?

1 Answers  


How many human genes are polymorphic?

1 Answers  


write a short note on Overloading of Binary Operator?

2 Answers  


What is inheritance in oop?

1 Answers  


Following are the class specifications: class {int a}; class {int b}; Using friend funtion,calculate the max of two objects and display it.

1 Answers  


Why do we use encapsulation in oops?

1 Answers  


which feature are not hold visual basic of oop?

1 Answers   Ignou,


Can we have a private virtual method ?

8 Answers   Ness Technologies,


Categories