Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Nama : Josua Efendy Sitohang

NIM : 012.17.022

Mata Kuliah : Pengetahuan Teknologi Informasi

Dosen Pengampu : Hanifadinna, ST., MT.

Tugas PTI 11 Desember 2020

1. Using while loop; write a program that prints alphabets ‘a’ through ‘z’ in separate lines. Use %c
in your format string. You can increment a character type variable with ++ operand.

2. Write a program that accepts time in “seconds” format and prints it in minutes and seconds. For
example if you enter 89 it must print: 1:29 (you can use % modulus operator to compute the
remaining of a division)
3. Using for loop, write a program that accepts net sales of a shop for each day. Then calculate sales
for a month then deduct %5 tax and finally calculate “average daily sales” after tax deduction.
Print results on the screen.
a. Input

b. Output

You might also like