WAP in Java to enter two numbers and display the smaller number.
Answers
Answered by
1
Answer:
n the above program, two numbers 1.20f and 2.45f which are to be swapped are stored in variables: first and second respectively.
The variables are printed before swapping using println() to see the results clearly after swapping is done.
First, the value of first is stored in variable temporary (temporary = 1.20f).
Then, value of second is stored in first (first = 2.45f).
And, finally value of temporary is stored in second (second = 1.20f).
This completes the swapping process and the variables are printed on the screen.
Remember, the only use of temporary is to hold the value of first before swapping. You can also swap the numbers without using temporary.
Explanation:
plz mark me as brainlist
Answered by
1
Answer:
answer of your questions
Attachments:
Similar questions