Professional Documents
Culture Documents
STE Workbook
STE Workbook
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