Challenge 5: Finding Minimum Value in an Array

This challenge gives an array. Find the minimum value in an array.

Problem statement

Implement a function findMinimum(int arr[], int size), which takes an array arr and its size and returns the smallest number in the given array.

Input

An array of integers is given.

Output

The output is the smallest number in the array.

Sample input

arr = [9,2,3,6]

Sample output

2

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.