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 does oop mean in snapchat?
write knight tour problem which is present in datastructure
What is the difference between abstraction and polymorphism?
class type to basic type conversion
How do you achieve polymorphism?
I have One image (means a group photo ) how to split the faces only from the image?............ please send the answer nagadurgaraju@gmail.com thanks in advace...
What does sksksk mean in text slang?
i got a backdoor offer in process global,Bangalore..Can i work with it?
Why do we use class in oops?
class CTest { public: void someMethod() { int nCount = 0; cout << "This is some method --> " << nCount; } }; int main() { CTest *pctest; pctest->someMethod(); return 0; } It will executes the someMethod() and displays the value too. how is it possible with our creating memory for the class . i think iam not creating object for the class. Thanks in Advance... Prakash
What are benefits of oop?
What are the important components of cohesion?
What is persistence in oop?
What is the point of oop?
What are two types of polymorphism?