You are on page 1of 1

Programming II (CSNB244) – Lab I

Topics: Recall
Congratulations! You are now at the next level of C programming subject. However, this lab
assessment is to help you to recall most of the lesson that you have learnt in Programming 1.
Let’s test your problem solving and programming skill!

Problem 1
You are required to write a C program to print the following texts;

Hello there!
How are you?
Welcome back to the C programming lab.
All the best in your study.

This program should not receive any input from the user. This program should only use
ONE (1) printf statement.

Problem 2
Write a program that prompts the user for a word (in string), and prints its reverse

Problem 3
Write a program that will print an isosceles triangle (segi tiga sama) of height and width. For
example, if height = 4, then width = 4. Show the width and height of the shape by using
asterisk ( * ) symbol. One symbol represents one value. The user should be able to set the
height and width value in integer.

*
**
***
****

Problem 4
Write a program that will receives 2 integers from user. Then compare the value. The
output should show which input is bigger than the other.

Problem 5
In mathematics, a power of two means a number of the form 2n where n is an integer, i.e.
the result of exponentiation with as base the number two and as exponent the integer n.
Write a program that will calculate the value of power of two, where the value of n is set by
the user. The value of n must be a positive integer.

Page 1 of 1
COIT – SN 20/10/2013

You might also like