Lab 3 - For-while loop
Lab 3 - For-while loop
LAB 3
Topic:
For-while Loop
Total Marks: 1
Marks:
Exercise 1 2 Total
Obtained
CLO Marks:
CLO2.2, S2 Total
Allocated 1 1
Obtained
Kingdom of Saudi Arabia المملكة العربية السعودية
Ministry of Education وزارة التعليم
University of Jeddah جامعة جدّة
College of Science and Computer Engineering
كلية علوم و هندسة الحاسب
Objectives
1 Ability to receive input from keyboard
2 Use the printf statement as an alternative to cout.
3 Ability to use For loop
4 Ability to use Do-while loop
• Input: The program should accept a positive integer 𝑛 from the user as input. If the given
input is not a positive input it should prompt the user to retry
• Output: The program should then count all numbers from 0 up to 𝑛 that are multiples of 5
and print them out on a single line on the screen.