1. Engineering
  2. Computer Science
  3. overview write a program that will perform simple arithmetic using...

Question: overview write a program that will perform simple arithmetic using...

Question details

Overview

Write a program that will perform simple arithmetic using two integer values and display the results of the arithmetic.

Basic Program Logic

  • prompt the user for the first number. This is an integer value that should be stored in an integer variable.

  • prompt the user for the second number. This is an integer value that should be stored in an integer variable.

  • calculate the following:

    • first number + second number
    • first number - second number
    • first number * second number
    • first number / second number
    • first number % second number
    • second number - first number
    • second number / first number
    • second number % first number
  • display the results of the 8 arithmetic calculations as shown in the sample output below

Use type int for all of the variables. Make sure to use meaningful variable names.

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution