You are on page 1of 1

C Programming Lab Exercises

Part 2

1. Write a C program that calculates the average of elements in an array of size 5.


e.g. float arr[] = {10,12,10,12,10};
→ output: 10.8

2. Write a C program that calculates the lowest number in an array of size 5 using
a function.

3. Write a C program that calculates the sum of a value m times using a function.
e.g. summation(n, m) → n + n + n

power(2, 4) → 2 + 2 + 2 + 2 = 8

C Programming Lab Exercises Part 2 1

You might also like