| marp | true |
|---|---|
| title | Programming 1 - Homework 2 |
| author | Benjamin Wilking |
| theme | uncover |
| style | section { font-size: 30px } |
| class | invert |
| paginate | false |
Requirements: Basics in C #1
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 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!