Lab Exercise 04
Using while-loop
1. Write a while loop to print the multiples of 3 from 300 down to 3.
2. Write a while loop to print the odd numbers from 1 to 99 (inclusive). Your
program must able to calculate the total odd numbers.
3. Write a while loop that lets the user enter a number. The number input by the user
should be multiplied by 10 and store the result in the variable named
product.The loop should iterate as long as product contains a value less than
100.
4. Write a program that asks user the user for a positive integer value. The program
should use a loop to get the sum of all the integer s from 1 up to the number
entered. For example, if the user enters 50, the loop will find the sum of 1, 2, 3,....
50.
Faculty of Information and Computing Technology | BTT121 | Page 1 of 1