Find the largest number in an array {10, 25, 17, 35, 20}.
MediumProblem Statement
Find the largest number in an array {10, 25, 17, 35, 20}.
Sample Input
10 25 17 35 20
Sample Output
Largest number: 35
Limits
Time: 2s · Memory: 256 MB
Code Editor
00:00
#include <stdio.h>
int findLargest(int arr[], int n) {
// Your code here
}
int main() {
int arr[] = {10, 25, 17, 35, 20};
printf("Largest number: %d\n", findLargest(arr, 5));
return 0;
}
Input
10 25 17 35 20
Expected Output
Largest number: 35