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 full form of oops?
What is an example of genetic polymorphism?
class type to basic type conversion
What is the real life example of polymorphism?
Why is static class not inherited?
Why do while loop is used?
What is abstraction encapsulation?
What are constructors in oop?
Can you explain polymorphism?
design a c++ class for the chess board,provide a c++ class definition for such class(only class definition is required)
write a program that takes input in digits and display the result in words from 1 to 1000
What is polymorphism what is it for and how is it used?
How to call a non virtual function in the derived class by using base class pointer
How is class defined?
Can bst contain duplicates?