#include<stdio.h>#include<conio.h>int main(){ int a,b,c; clrscr(); printf("Enter first number:"); // input from user scanf("%d",&a); printf("Enter second number:"); scanf("%d",&b); printf("Before swapping:%d %d\n",a,b); c = a; a = b; // swapping using three variables b = c; printf("After swapping:%d %d\n",a,b); getch();}
No comments:
Post a Comment