demo-for-loops - // print out every 10th year from...

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

View Full Document Right Arrow Icon
// Demo of a simple for loop #include <iostream> using namespace std; int main() { for(int i = 1; i <=5; i++) // print out counting from 1 to 5 { cout << i << '\t'; } cout << endl; // separate outputs for(int j = 1890; j < 2020; j=j+10)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: // print out every 10th year from 1890-2010 { cout &lt;&lt; j &lt;&lt; '\t'; } cout &lt;&lt; endl; // separate outputs for(char k = 'D'; k &lt; 'J'; k++) // print out some letters { cout &lt;&lt; k &lt;&lt; '\t'; } return 0; }...
View Full Document

Ask a homework question - tutors are online