Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Write a function to find the minimum element in an array {3, 5, 2, 8, 1}.

Medium

Problem Statement

Write a function to find the minimum element in an array {3, 5, 2, 8, 1}.

Sample Input

3 5 2 8 1

Sample Output

Minimum element: 1

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
#include <stdio.h> int findMin(int arr[], int n) { // Your code here } int main() { int arr[] = {3, 5, 2, 8, 1}; printf("Minimum element: %d\n", findMin(arr, 5)); return 0; }
Log in or sign up to run or submit your code.Log inSign up
Input
3 5 2 8 1
Expected Output
Minimum element: 1