Example 1 : Largest element in an array

TopicDifficultyCompanies
Iteration and Two Pointer Approach
EASY

Given an array arr[] of size n , write a program to find the largest element in it.

Example 1:

Input: arr[] = [100, 50, 4]
Output: 100
Explanation: 100 is the largest element in the given array.

Code Editor

Practice and Learn

Best way to learn is through solving real problems. Practice this problem in this code editor.