



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Lab; Class: PRBLM SOLVNG:COMPUTR; Subject: Computer Science and Engineering ; University: University of Nebraska - Lincoln; Term: Spring 2009;
Typology: Lab Reports
1 / 5
This page cannot be seen from the preview
Don't miss anything!




CSCE150A
While do-while for
Lecture 05 – Loops
Derrick Stolee
Spring 2009
1 / 5^ [email protected]
CSCE150A
While do-while for
General format while ( check condition ) { executable1; executable2; change variable in conditional statement } Must make a change in conditional variable within the loop! Compile sam3.c and run.
CSCE150A
While do-while for
General format for ( x = 0; x < maxValue; x++) { executable1; executable2; } Should NOT make a change in conditional variable! Compile sample6.c and run.
CSCE150A
While do-while for
(^1) Write a program that will find the smallest, largest, and average values in a collection of N numbers. The number N will be given to the program by the user. Also compute and display the range of values in the data collection (the minimum and maximum numbers entered), and the standard deviation of the data collection. To compute the standard deviation, accumulate the sum of the squares of the data values (sum squares) in the main loop. After loop exit, use the formula
standarddeviation =
sum squares N − average^2