Exam 1- 2010

If n is less than 1 do not print anything

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

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ; endl; (d) for (int i=1; i < 0; i++) { cout << "Howdy!\n"; } CS 115 Exam 1, Spring 2010 Page 4 of 7 Problem 3: 30 points. Write short snippets of code to accomplish the following tasks: (a) Assume: o An integer variable N has already been declared and defined. Your task: o Print the square root of every number between 1 and N, inclusive. If N is less than 1, do not print anything. (b) Assume: o Float variables A, B, and C have already been declared and defined. Your task: Print the mode of this data. That is: o If two or more of the variables’ values are equal to each other, print their...
View Full Document

This note was uploaded on 02/08/2014 for the course CS 115 taught by Professor Staff during the Fall '08 term at Sonoma.

Ask a homework question - tutors are online