Swapping Using 3rd variable in C - 👑 सार्थक मुंड S3 🤴🏻

Swapping Using 3rd variable in C

Banner

Write a program (WAP) in C to read two numbers from keyboard(User Input) and exchanging the value of two variable(Swapping).

#include <stdio.h>
int main()
{
  int a,b,temp;
  printf("Enter two Numbers A & B :\n");
  scanf("%d%d", &a, &b);
  printf("Before Swapping :\nA = %d\nB = %d\n", a,b);
  temp = a;
  a = b;
  b = temp;
  printf("After Swapping :\nA = %d\nB = %d\n", a,b);
  return 0;
}

Try it Yourself ➠
output
Must Read :-
  1. Blogger Tutorial
  2. C Programs
  3. C++ P rograms
  4. Java Programs
  5. Python Programs
  6. Programming Notes 
  7. Questions & Answers
  8. My Codes : HTML, CSS & JS
  9. All Subject Notes
Previous article
Next article

Leave Comments

Post a Comment

Articles Ads

Articles Ads 1

Articles Ads 2

Advertisement Ads