#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;
}
http://codingc++.fashionandcs.com Program to display the output : Syntax: The syntax used to display the output within the C++ Program is cout must use angle brackets << and the semi colon ; with the sysntax if we want to display the word same as written, we uses " like: we want to display the word program we will write as: cout<<"program"; You can see the folowing program #include < iostream > using namespace std; int main() { cout << "Programming"; return 0; }
Comments
Post a Comment