write a program to swap Two numbers without using temp variable.
Answer Posted / swechha
a=a-b
b=a+b
a=b-a
if a=5 and b=10 then
a=5-10=(-5)
b=(-5)+10=5
a=5-(-5)=5+5=10
now a=10 & b=5
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are pointers? What are different types of pointers?
What is use of integral promotions in c?
will u please send me the placement papers to my mail???????????????????
The process of repeatedly running a set of computer instructions until some condition is specifed a) condition b) sequential condition c) global d) iteration
Explain how can I convert a string to a number?
What is the return type of sizeof?
Write a C program that will accept a hexadecimal number as input and then display a menu that will permit any of the following operations to be carried out: Display the hexadecimal equivalent of the one's complement. (b) Carry out a masking operation and then display the hexadecimal equivalent of the result. (c) Carry out a bit shifting operation and then display the hexadecimal equivalent of the result. (d) Exit. If the masking operation is selected, prompt the user lor the type of operation (bitwise and, bitwise exclusive or, or bitwise or) and then a (hexadecimal) value for the mask. If the bit shifting operation is selected. prompt the user for the type of shift (left or right), and then the number of bits. Test the program with several different (hexadecimal) input values of your own choice.
Explain two-dimensional array.
Write a code to generate divisors of an integer?
what are non standard function in c
Write a simple code fragment that will check if a number is positive or negative.
How many parameters should a function have?
When was c language developed?
What is the difference between the = symbol and == symbol?
What is the use of function in c?