write a program to swap Two numbers without using temp variable.
Answer Posted / ashish kumar sharma
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf("enter the Value of a:\n");
scanf("%d",&a);
printf("enter the Value of b:\n");
scanf("%d",&b);
a=a+b;
b=a-b;
a=a-b;
printf("Display The Swapping:\n");
printf("a=%d And b=%d",a,b);
getch();
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
How to Throw some light on the splay trees?
Can static variables be declared in a header file?
How do you generate random numbers in C?
Using functions, write a program that multiplies two arrays. Use the following functions: - Function ReadArray - Function MultiplyArrays - Function DisplayArrays
What are the types of unary operators?
can any one tel me wt is the question pattern for NIC exam
What is NULL pointer?
what value is returned to operating system after program execution?
How a string is stored in c?
What is the c language function prototype?
How can I implement sets or arrays of bits?
What does 1f stand for?
In C language what is a 'dangling pointer'?
Which operators cannot be overloaded a) Sizeof b) .* c) :: d) all of the above
What is the process of writing the null pointer?