How to resolve the algorithm Greatest element of a list step by step in the i programming language

Published on 12 May 2024 09:40 PM
#I

How to resolve the algorithm Greatest element of a list step by step in the i programming language

Table of Contents

Problem Statement

Create a function that returns the maximum value in a provided set of values, where the number of values may not be known until run-time.

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Greatest element of a list step by step in the i programming language

Source code in the i programming language

concept largest(l) {
	large = l[0]
	for element in l
		if element > large
			large = element
		end
	end
	return large
}

software {
	print(largest([23, 1313, 21, 35757, 4, 434, 232, 2, 2342]))
}

  

You may also check:How to resolve the algorithm Terminal control/Unicode output step by step in the Arturo programming language
You may also check:How to resolve the algorithm CSV to HTML translation step by step in the Icon and Unicon programming language
You may also check:How to resolve the algorithm Loops/While step by step in the Spin programming language
You may also check:How to resolve the algorithm Modular arithmetic step by step in the VBA programming language
You may also check:How to resolve the algorithm Brazilian numbers step by step in the EasyLang programming language