Answer to Question #4799 in C++ for Saurabh Kaura

Question #4799
Write a C++ program to allow the user to enter any ten numbers and then display their sum using for loop.
1
Expert's answer
2011-10-21T11:22:41-0400
#include <iostream.h>
#include <conio.h>
main(){
int i,a,s;
s=0;
for (i=1;i<=10;i++){
& cout<<"Enter a number: ";
& cin>>a;
& s = s+a;
}
cout<<"Sum = "<<s;
getch();
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS