Program To Find Largest Number Among Three Numbers In Lua – Programming Code Examples
Lua

Program To Find Largest Number Among Three Numbers In Lua1 min read

To find the greatest of three numbers in Luathese three numbers must be taken as the input from the user, and the output of the program will determine the largest of all the numbers.

To find Greatest of three Numbers in Lua

Ask the user to enter three integer values. Read the three integer values in num1, num2, and num3.




The check if num1 is greater than num2 and num3. If statement returns true, then print ‘num1’ as the greatest number.
If statement returns false, then check if num2 is greater than num3 and num1.
second If statements returns false, then print ‘num2’ as the greatest number.
if statement returns false then print ‘num3’ as the greatest number.

Lua Code:

Output:

Program To Find Largest Number Among Three Numbers In Lua
Program To Find Largest Number Among Three Numbers In Lua

Leave a Comment