Challenge: Find Minimum Value in an Array

Given an array, can you find the minimum value in an array? Implement your solution in C++ and see if your output matches the expected output.

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

Output: #

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.