Académique Documents
Professionnel Documents
Culture Documents
________________________________________________________________________________
QUESTIONS 1. Re-write the program of Lab6 Question 2 using do..while loop. 2. Re-write the program of Lab6 Question 2 using for loop. 3. Re-write the program of Lab6 Question 4 using do..while loop. 4. Re-write the program of Lab6 Question 5 using for loop. 5. Re-write the program of Lab6 Question 6 using do..while loop. 6. Improve the program of Lab6 Question 2 (which is supposedly written by implementing a while loop) by implementing proper input data validation. In the new program, using another set of while loop, informs the users should they have entered a wrong input and tells the users to reenter the input. A sample input and output of the program is as follows:
How many times do you want to print the message?: 0 Invalid data. Please re-enter. The value to be entered must be greater than zero How many times do you want to print the message?: 2 Congratulation! You now know how to write a simple C program. Congratulation! You now know how to write a simple C program.
7. Re-write the program in (6) by implementing proper input validation using for loop. 8. Re-write the program in (6) by implementing proper input validation using do..while loop.
-BS-May 2012 1