write a program to swap Two numbers without using temp variable.

Answer Posted / ragini

#include<stdio.h>
#include<conio.h>
void swap(int a,int b);
void main()
{
int a,b;
swap(a,b);
printf("Enter the 2 nos");
scanf("%d%d",&a,&b);
}
void swap(int x,int y)
{
x=x*y;
y=x/y;
x=x/y;

}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of c language in real life?

521


How many loops are there in c?

569


How can I find out the size of a file, prior to reading it in?

610


Can we assign integer value to char in c?

609


What are the disadvantages of external storage class?

582






What does s c mean in text?

600


What is the purpose of scanf() and printf() functions?

709


What does s c mean on snapchat?

579


Explain that why C is procedural?

648


How many types of sorting are there in c?

600


What is ctrl c called?

584


Can you please explain the difference between exit() and _exit() function?

582


How can I change their mode to binary?

686


What is call by value in c?

550


Is c is a procedural language?

586