Hiiii friend, how are you!!,
                                             Here i am write a small progrom which name is swap by value.
I hope you like this.If you like this please comment in comment box to appreciate me.
swap by value program in c


  • swap by value



#include<stdio.h>
#include<conio.h>

void swap(int a,int b)
{
 int temp=a;
 a=b;
 b=temp;
 printf("\n after swaping x=%d \ty=%d",*a,*b);
}

void main()
{
 int x=10,y=5;
 clrscr();
 printf("original value x=%d\ty=%d",x,y);
 swap(x,y);
 getch();
}

Post a Comment

Hii

أحدث أقدم