Click here to Upload your own logic for this program.

Write a program swapping or interchange two numbers.(using third variable)


Program:


#include<stdio.h> main() { int x,y,t; printf("Enter two numbers:\n"); scanf("%d%d",&x,&y); printf("The Entered numbers are:%d,%d\n",x,y); t = x; x = y; y = t; printf("After swapping the numbers are:%d,%d\n",x,y); }
Output:
		

Enter two numbers: 3 4 The Entered numbers are:3,4 After swapping the numbers are:4,3