C programming
#include <stdio.h>
Try it Yourself ➠
Swapping Using 3rd variable in C
12 May
0
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 ➠
Must Read :-
Previous article
Next article
Leave Comments
Post a Comment