☰ Contents · Computing

The while loop and its practice

Lessons 44–45 · 2 lessons · M. R. Fayziyeva, D. M. Sayfurov, N. S. Xaytullayeva. Informatics and Information Technologies, Grade 9. “Nashriyot uyi Tasvir”, Tashkent, 2020
Answers are for parents and teachers.
1
In this program, what is k at the end? n = 20 ⏎ k = 0 ⏎ while n > 1: ⏎     n //= 2 ⏎     k += 1
2
Write a program that prints the odd numbers from 1 to 9 with while.
3
Find the product of the digits of a typed number (24 for 234).
4
Why is the starting value of p 1 in the product of digits program?