Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write code that uses an if statement to compare two variables and display all of the results that apply. The comparisons that are used should

Write code that uses an if statement to compare two variables and display all of the results that apply. The comparisons that are used should include the following: <,, >, , and =.

  1. Declare the two integers that will be used throughout this code.
  2. Use the function learned in the previous lab to display a message on the screen that prompts the user to enter the variables.
  3. Use a function to read the two variables that were written by the user.
  4. Write an if statement that compares the two numbers to see if they are equal and displays the result.
    • Write that if statement in the space provided.
  5. Write the additional if statements needed to complete all of the comparisons listed above.
  6. Execute the code.
    • Provide a copy of the finished code in the space provided.

***Answer must be typed*****

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions