Write an algorithm to swap the values of two variables
Answers
Answered by
2
swap(int)
{
i<- a ,j<- b;
while(a>0&&b>0)
{
a=b;b=k;k=b;
}
}
int i,j,k
{
swap(I;j)
}
{
i<- a ,j<- b;
while(a>0&&b>0)
{
a=b;b=k;k=b;
}
}
int i,j,k
{
swap(I;j)
}
Similar questions