create a c++ program that will ask 10 numbers and display
their sum using array.
Answer Posted / 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 View All Answers
Which is better struts or spring?
What is abstraction example?
Can you inherit a private class?
What is an advantage of polymorphism?
Why is abstraction used?
Is html an oop?
What does I oop mean?
What is difference between oop and pop?
just right the logic of it 1--> If few people are electing then every time ur candidate should win 2--> arrange books in box, if box carry weight == books weight then take another box..... find the no of box required.
write a program to find 2^n+1 ?
Can we create object of interface?
What are oops methods?
c++ program to swap the objects of two different classes
What is multilevel inheritance explain with example?
What is oops and its features?