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

Programming Exercises

Write a Go program to find the largest number in an array.

Easy

Problem Statement

Write a Go program to find the largest number in an array.

Sample Input

An array of integers (e.g., [10, 20, 5, 15]).

Sample Output

20

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
package main import "fmt" func findLargest(arr []int) int { // Write code to find the largest number in the array return 0 } func main() { arr := []int{10, 20, 5, 15} fmt.Println(findLargest(arr)) }
Log in or sign up to run or submit your code.Log inSign up
Input
An array of integers (e.g., [10, 20, 5, 15]).
Expected Output
20