Skip to content

Latest commit

 

History

History
43 lines (32 loc) · 892 Bytes

File metadata and controls

43 lines (32 loc) · 892 Bytes
marp true
title Programming 1 - Homework 2
author Benjamin Wilking
theme uncover
style section { font-size: 30px }
class invert
paginate false

Homework #2

Requirements: Basics in C #1


Grades Average

Write a program in C to calculate the average (rational number) of multiple grades (natural numbers). Output the result on the command line with one digit after the decimal point. Use an array for the grades. The size of the array should be fixed (e.g. 5 elements).

Example:

Values: 1, 2, 4, 1, 3
Average: 2.2  

Calculate Percentages

Write a program in C to calculate a given percentage of value, where the percentage and the value should be natural numbers. The result of the calculation is a rational number. Example:

Value: 90
Percentage: 11
11% of 90 equals 9.9!