C program to swap two integers using third variable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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)