Sum of Different Variables

Sum of Different Numbers:



Program:

#include < iostream >
using namespace std;
int main()
{
int a;
int sum=0;
for(int k = 0; k < 5; k++)
{
cin >> a;
sum = sum + a;
cout << "The sum = " << " " << sum << endl;
}
return 0;
}

Comments

Popular posts from this blog

How to display the output in C++