write a program to swap Two numbers without using temp variable.
Answer Posted / rakesh
#include<stdio.h>
#include<conio.h>
void main()
{
int a=10,b=8;
a=a+b;//a=10+8=18
b=a-b;//b=18-8=10
a=a-b;//a=18-10=8
//hence a=8,b=10
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is difference between scanf and gets?
Are global variables static in c?
How can a number be converted to a string?
What is chain pointer in c?
Why is sizeof () an operator and not a function?
Differentiate abs() function from fabs() function.
What is 1d array in c?
Do array subscripts always start with zero?
How can I write a function that takes a format string and a variable number of arguments?
Why is main function so important?
What is the heap in c?
What is strcmp in c?
What is the difference between exit() and _exit() function?
Using functions, write a program that multiplies two arrays. Use the following functions: - Function ReadArray - Function MultiplyArrays - Function DisplayArrays
Differentiate between #include<...> and #include '...'