Algorithms for Swapping of Two Numbers

Subject: PPS (Programming for Problem Solving)

Contributed By: Sanjay

Created At: February 3, 2025

Question:


Write an Algorithms for Swapping of Two Numbers Using Temporary Variable

Explanation Video:

Custom Image

Explanation:

Algorithm:

  1. Start.

  2. Read two numbers, a and b.

  3. Declare a temporary variable temp.

  4. Assign temp = a.

  5. Assign a = b.

  6. Assign b = temp.

  7. Print a and b.

  8. Stop.

Share this Article & Support Us:
Status
printf('Loading...');