ManualSum9a - { int sum = 0; int n; int count; i cout...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
// file: ManualSum.cpp // author: j. dzuback // modified: // date: / /* ********************************************** The program prompts the user for an integer value n, and then finds the sum of the numbers from 0 to n. This variation of a summing loop has a few variations. .. ********************************************** */ #include <iostream> #include <iomanip> #include <string> # using namespace std; u int main()
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: { int sum = 0; int n; int count; i cout << "Enter an integer (less than 20) and press return: "; cin >> n; cout << endl << endl; c count = 0; c for (count=0; count <=n; count++) { sum = sum+count; } } // end of loop cout << "Sum of the digits between 0 and " << n << " is: " << sum << endl << endl; cout << "*** end of ManualSum ***" << endl << endl; return 0; } // end of main...
View Full Document

This note was uploaded on 02/08/2011 for the course CSC 101 taught by Professor Joedzuback during the Spring '11 term at Union County.

Ask a homework question - tutors are online