Skip to main content

Write a C program to interchange the values of two given integer.


#include<stdio.h>
#include<conio.h>
main()
{
    int x,y,t;
    printf("Enter the value of x&y \n:");
    scanf("%d%d",&x,&y);
    printf("Before Swapping \n x=%d\ny=%d\n",x,y);
    t=x;
    x=y;
    y=t;
    printf("After Swapping \n x=%d\ny=%d\n",x,y);

    getch();

}