You are on page 1of 2

LABORATORY EXERCISE 5-4 Comparing Integers

LAB EXERCISE 1-1

Ryan Noah L. Fragio Score:


Name: ___________________________________________________________
December 8, 2023
Date: ____________________________________________________________

1. (Comparing Integers) Write a program that asks the user to enter two integers,
obtains the numbers from the user, then prints the larger number followed by the
words “is larger.” If the numbers are equal, print the message “These numbers are
equal.” Use only the single-selection form of the if statement.

2.Output
LABORATORY EXERCISE 5-4 Comparing Integers
LAB EXERCISE 1-1

2. Algorithm

1. Start
2. Declare two integer variables, a and b
3. Print "Enter two integers: "
4. Read the values of a and b
5. If a is greater than b, then
6. a. Print "a is larger."
7. Else, if b is greater than a, then
8. a. Print "b is larger."
9. Else
10. a. Print "These numbers are equal."
11. End

You might also like