Input and Output Exercises
Input and Output Exercises
Instructions:
Save each file as lastlame_io#. example: bergado_io1.c up to bergado_io10.c. Put all the 10 files (.c files
only) in one folder with folder name lastname_stdio. Then compressed the folder to .zip or .rar and
submit it in this Google form https://forms.gle/kEyzhkPwfByzuGGLA. The deadline for submission is on
or before September 17, 11:00 PM.
1. Create a program that asks for a distance in kilometers and converts it into its metric equivalent.
2. Write a program that asks the user to enter the radius of a circle and then compute its area. Recall
that the formula to compute the area is
area = pi x r2, where r is the radius.
The output must be similar to the one below.
The area of the circle with a radius of 2cm is 12.56 cm2.
4. Write a program that will compute and display the midterm grade of a student. The midterm
grade is equal to one-third of the minor A exam and two-thirds of the midterm exam.
5. Create a program that will input a number in kilowatts and display its equivalent measure in watts.
6. Create a program that will compute and display the area of a square. Recall that the formula to
compute the area is
area = s2 where s is the side of the square.
7. Make a program that will convert an inputted number in inches (in.) and display its equivalent
measure in feet (ft).
8. Create a program that will get as input from the user the base and height of a triangle. Compute
and display the area of the triangle.
9. Write a program that inputs two real numbers and then exchanges their values.
10. Make a program that will accept a number in square meters (m) and display its equivalent
measure in hectares (has).
Hint: 10,000 m2 = 1 ha