Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Create a Java program that declares and initializes two integer variables, num1 and num2, with values of your choice 2. Output the values of

1. Create a Java program that declares and initializes two integer variables, "num1" and "num2", with values of your choice

2. Output the values of "num1" and "num2" to the console using the System.out.println() method.

3. Use the addition operator (+) to add "num1" and "num2" together and output the result to the console.

4. Use the subtraction operator (-) to subtract "num2" from "num1" and output the result to the console.

5. Use the multiplication operator (*) to multiply "num1" and "num2" together and output the result to the console.

6. Use the division operator (/) to divide "num1" by "num2" and output the result to the console.

7. Use the modulus operator (%) to find the remainder when "num1" is divided by "num2" and output the result to the console.

8. Use the increment operator (++) to increment the value of "num1" by 1 and output the new value to the console.

9. Use the decrement operator (--) to decrement the value of "num2" by 1 and output the new value to the console.

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

Recommended Textbook for

Oracle Solaris 11.2 System Administration (oracle Press)

Authors: Harry Foxwell

1st Edition

007184421X, 9780071844215

More Books

Students also viewed these Databases questions

Question

Who was your first crush?

Answered: 1 week ago

Question

What are the skills of management ?

Answered: 1 week ago

Question

5. Describe the impossible trinity.

Answered: 1 week ago