You are on page 1of 1

BIT10303 COMPUTER PROGRAMMING

FACULTY OF COMPUTER SCIENCE AND INFORMATION TECHNOLOGY


UNIVERSITI TUN HUSSEIN ONN MALAYSIA
1st Semester 20222023

Lab activity 06
Repetition Structure

Objective:
Learning of: -
1. do … while / while statement
2. for… loop
Instructions:
1. Using C language and develop a program.
2. Submit via author before end of lab session.

Exercise:
1. Write a simple program to calculate total expenses in a year by using for…loop.

Month RM
1 1476.17
2 139.90
3 111.25
4 344.20
5 496.80
6 150.00
7 254.00
8 255.00
9 200.00
10 272.80
11 380.00
12 210.35
Grand Total ?

2. Write a program that’s asks for a number between 0 and 50, then counts backwards
from the number back to 0. (while loop)
3. Write a program that’s asks for a number between any integer number but must not
more than 100, then counts forwards from number entered by user to 100. Then, the
program repeating until character ‘S’ as input by using do…while.

You might also like