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
What is the use of oops?
Why is static class not inherited?
What is the diamond problem in inheritance?
What is class in oop with example?
why reinterpret cast is considered dangerous?
What is ambiguity in inheritance?
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!!!)
What is oops in simple words?
What is overloading in oop?
is there any choice in opting subjects like 4 out of 7
i got a backdoor offer in process global,Bangalore..Can i work with it?
What is difference between data abstraction and encapsulation?
What is difference between abstraction and encapsulation?
What is polymorphism give a real life example?
Whats is abstraction in oops?