Q c program to swap two numbers
swapping of two numbers in c
here is c example how to swap two numbers using third varibale
#include<stdio.h>int main(){
int x,y, temp;
printf("Enter the value x and y\n");
scanf("%d%d",&x,&y);
printf("before swappingx=%d y=%d\n",x,y);
temp=x;
x=y;
y=x;
printf("after swapingx=%d y=%d\n",x,y);
return 0;
}
No comments:
Post a Comment