Answer to Question #4799 in C++ for Saurabh Kaura
Write a C++ program to allow the user to enter any ten numbers and then display their sum using for loop.
1
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!
Learn more about our help with Assignments:
C++
Comments
Leave a comment