Lab-5 Journal-05-31032023-091050am
Lab-5 Journal-05-31032023-091050am
Objective(s):
Upon completion of this lab session, students will be able to:
• Understanding of Loop statements
Tasks
Task 1
Write a program that uses a loop to display the characters for the ASCII codes 0 to 127.
Display 16 characters on each line.
Task 2
By applying for loop, write a C++ program that prints
a) A sequence of numbers in ascending order from 1 to 100 (inclusive).
b) Modify your program in part (a) to make it prints odd numbers within 1 to 100.
c) Write a C++ Program that receives a positive integer (N) and prints a series of
numbers from 1 to N (inclusive) in ascending order.
d) Write a C++ Program that displays a series of alphabets in descending order from ‘Z’
to ‘A’.
e) Modify your program in part (d) so that the program will display consonants only, no
vowels.
f) Write a C++ program that receives start value and end value. Then, your program will
display a series of numbers from the start value to the end value inclusive.
%
Max Obtained
Task Comments (if any)
Marks Marks
1. 05
2. 10
3. 05
Total 20 Signature
Note: Attempt all tasks and get them checked by your Lab Instructor.
Page 2 of 2