C program to swap two integers using third variable
#include <stdio.h> | |
void main() { | |
int a, b, c; | |
printf("Enter two integer values for swapping : "); | |
scanf("%d %d", &a, &b); | |
printf("A = %d, B = %d\n", a, b); | |
c = a; | |
a = b; | |
b = c; | |
printf("After swapping :\n"); | |
printf("A = %d \t, B = %d\n", a, b); | |
printf("===End===\n"); | |
} |
Top comments (0)