Question: Write a while loop that prints a. All squares less than n. For example, if n is 100, print 0 1 4 9 16 25
Write a while loop that prints
a. All squares less than n. For example, if n is 100, print 0 1 4 9 16 25 36 49 64 81.
b. All positive numbers that are divisible by 10 and less than n. For example, if n is 100, print 10 20 30 40 50 60 70 80 90
c. All powers of two less than n. For example, if n is 100, print 1 2 4 8 16 32 64.
Step by Step Solution
3.50 Rating (157 Votes )
There are 3 Steps involved in it
ANSWER a n 100 i 0 while i i n printi i end i 1 b n 100 i 0 while i n if i 10 0 printi ... View full answer
Get step-by-step solutions from verified subject matter experts
