Squares - } int main() { int count = 0 ; int n = 1 ; while...

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

View Full Document Right Arrow Icon
/* A simple program to compute the first 10 even squares. Author: Eric Van Wyk Date: January 19, 2010 */ #include <iostream> using namespace std ; bool even (int i) { return i % 2 == 0 ;
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 main() { int count = 0 ; int n = 1 ; while (count &lt; 10) { int sq = n * n ; if ( even (sq) ) { cout &lt;&lt; sq &lt;&lt; endl ; count = count + 1 ; } n = n + 1 ; } }...
View Full Document

This note was uploaded on 10/28/2010 for the course CSCI 1113 taught by Professor Staff during the Spring '08 term at Minnesota.

Ask a homework question - tutors are online