Professional Documents
Culture Documents
01 Introduction and Fundamentals Practical
01 Introduction and Fundamentals Practical
01 Introduction and Fundamentals Practical
Practical Exercises
1. Write a program that uses printf to display the following picture on the screen
*
*
*
* *
* *
*
2. Write a program that computes the volume of a sphere that has a 10‐metre radius.
3. Modify the program for question 2 so that it prompts the user to enter the radius of
the sphere.
4. Write a program that prompts the user to enter a value for x and then displays the
value of
6. Write a program that asks the user to enter an amount (in Rupiah) and then shows
how to pay that amount using the smallest number of 20,000, 10,000, 5,000 and
1,000 notes:
These questions are taken from the recommended textbook for this course:
K. N. King. C Programming; a Modern Approach (Second Edition). Norton and Company, 2008.
Enter a Rupiah amount: 93,000
20,000 notes: 4
10,000 notes: 1
5,000 notes: 0
1,000 notes: 3
7. Write a program that calculates the remaining balance on a loan after the first,
second and third monthly payments (in USD and cents):
These questions are taken from the recommended textbook for this course:
K. N. King. C Programming; a Modern Approach (Second Edition). Norton and Company, 2008.