Class Notes (839,147)
Canada (511,218)
CMPT 120 (49)
Greg Baker (15)

While Loops

1 Page

Computing Science
Course Code
CMPT 120
Greg Baker

This preview shows half of the first page. Sign up to view the full page of the document.
10052007CMPT120The while loopAn indefinite loopoDont know how many times well be repeatingoWe need a condition to decide when to continuestop loopingThe while loop is kind of like an if it needs a conditionoThe while keeps looping as long as the condition is trueoegask user for numbers have them enter 0 to stopprint Enter numbers 0 to stopcount1total00val1can be any number not equal to 0while val00valfloatrawinputEnter value strcount totaltotalvalcountcount1print Total strtotalwhen the program ge
More Less
Unlock Document

Only half of the first page are available for preview. Some parts have been intentionally blurred.

Unlock Document
You're Reading a Preview

Unlock to view full version

Unlock Document

Log In


Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.