0% found this document useful (0 votes)
49 views

Input and Output Exercises

The document provides 10 input/output exercises to create C programs that: 1. Converts kilometers to metric equivalent and asks for distance. 2. Computes the area of a circle given radius input and displays result. 3. Converts Fahrenheit to Celsius given temperature input. 4. Computes and displays student midterm grade from exam scores. 5. Converts kilowatts to watts given power input.

Uploaded by

Lance Asio
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views

Input and Output Exercises

The document provides 10 input/output exercises to create C programs that: 1. Converts kilometers to metric equivalent and asks for distance. 2. Computes the area of a circle given radius input and displays result. 3. Converts Fahrenheit to Celsius given temperature input. 4. Computes and displays student midterm grade from exam scores. 5. Converts kilowatts to watts given power input.

Uploaded by

Lance Asio
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

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.

3. Create a program that converts a Fahrenheit measure to a Celsius measurement


where (C=5/9(F-32)).

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

You might also like