Tuesday, 24 March 2015

How to find Running sum in C++ Programming using for loop in C++

How to find Running sum in C++ Programming using for loop in C++    #include<istream.h> int main() { int num; int sum=0; cout... thumbnail 1 summary

How to find Running sum in C++ Programming

using for loop in C++ 

 

#include<istream.h>
int main()
{
int num;
int sum=0;
cout<<"please enter five integer to find its sum"<<endl;
for(int a=1;a<6;a++)
{
cin>>num;
sum=sum+num;
};
cout<<"the sum is"<<endl;
cout<<sum<<endl;
system("pause");
return 0;
};