Site icon Pathshala Nepal

Write a function to input two different numbers and find the greatest number.

Modular programming
Online Calculator

Write a function to input two different numbers and find the greatest number.


1 Answer


DECLARE FUNCTION GRT (X, Y)
CLS
INPUT "ENTER TWO NUMBERS:"; X, Y
PRINT "THE GREATEST NUMBER:"; GRT (X, Y)
END

FUNCTION GRT (X, Y)
IF X > Y THEN G = X ELSE G = Y
GRT = G
END FUNCTION

Topics from Computer
Related Questions