Question: Create a script that will find the difference between two integers in your script and display result. The difference needs to be a positive number.

Create a script that will find the difference between two integers in your script and display result. The difference needs to be a positive number. (In other words, if the first number is larger than the second number, perform "first number - second number". If it is the other way around, perform "second number - first number".
Take for example, if
int Num1=90 and int Num2=100
the output should be
Num1=90 and Num2=100. Difference is 10.
Also,
int Num1=100 and int Num2=90
the output should be
Num1=100 and Num2=90. Difference is 10.
"Do this by using If Else Statement.
Save as homework04_5A.c
'Do this by using Ternary Operator.
Save as homework04_5B.c
 Create a script that will find the difference between two integers

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!