Worksheet 5 (Function)
Worksheet 5 (Function)
1. Write and test following area () function that returns the area of
a circle with given radius:
float area (Float r)
2. Write and test the following min () function that returns the
smallest of three given integers:
int min( int x, int y , int z)
8. Write and test a function that replaces all the negative numbers
in an array of integers with their absolute values.
MicroLink Information Technology College
Department of Computer Science
CS-131 Programming Fundamentals
Worksheet 5
1. Write and test following area () function that returns the area of
a circle with given radius:
float area (Float r)
2. Write and test the following min () function that returns the
smallest of three given integers:
int min( int x, int y , int z)
12. Write and test a function that replaces all the negative
numbers in an array of integers with their absolute values.