Write a Program to find Greatest Number Among Three Numbers

Greatest Number: In this program, user is asked to enter three numbers and this program will find the largest number among three numbers entered by user.
VB Script program will be as shown:-
First we ask user to enter three numbers and store them respectively in a, b, c variables. Next we have an if else condition which determines which of the three numbers is the biggest. Let’s understand how it works.
  • If a > b, then we check if a is also greater then c and if a > c then a is the biggest number. But if a < c in this case then c is the biggest of a, b and c.
  • If a < b then else part is executed. Then we check if c > b and if it is then c is the biggest number. Otherwise b is the biggest number of three.
VB Script program will be as shown:-



Out Put Of the Above Program








No comments:

Post a Comment