Computer Science, asked by premjasiwal1, 3 months ago

Write a program in BlueJ to swap the values of two variables without using the third variable.​

Answers

Answered by malavika5596
2

Answer:

Program to swap two numbers without using the third variable

STEP 1: START.

STEP 2: ENTER x, y.

STEP 3: PRINT x, y.

STEP 4: x = x + y.

STEP 5: y= x - y.

STEP 6: x =x - y.

STEP 7: PRINT x, y.

STEP 8: END.

Answered by YashodharPalav5109
0

Answer:

  • Program to swap two numbers without using the third variable
  1. STEP 1: START.
  2. STEP 2: ENTER x, y.
  3. STEP 3: PRINT x, y.
  4. STEP 4: x = x + y.
  5. STEP 5: y= x - y.
  6. STEP 6: x =x - y.
  7. STEP 7: PRINT x, y.
  8. STEP 8: END.

Similar questions