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

Answer Posted / akash

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf("enter the value a & b");
scanf("%d%d",&a,&b);
a=a+b;
b=a-b;
a=a-b;
printf("interchange in a & b =%d%d",a,b);
getch();
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does typedef struct mean?

654


Which operators cannot be overloaded a) Sizeof b) .* c) :: d) all of the above

654


Can we declare variable anywhere in c?

533


code for find determinent of amatrix

1511


What are header files? What are their uses?

632






What math functions are available for integers? For floating point?

616


How will you find a duplicate number in a array without negating the nos ?

1637


What is define c?

568


Explain the array representation of a binary tree in C.

724


What is the purpose of the preprocessor directive error?

676


Differentiate between declaring a variable and defining a variable?

602


What is quick sort in c?

577


What is #define used for in c?

609


Write a program in "C" to calculate the root of a quadratic equation ax^2+bx+c=0, where the value of a,b & c are known.

1718


List some basic data types in c?

557