write a program to swap two numbers without using temporary
variable?
Answer Posted / it diploma student
let a and b be the variables
a=a+b
b=a-b
a=a-b
if we take a=5 and b = 7 then
a = 5+7 = 12
b = 12-7 = 5
a = 12-5 = 7
hence swaped...
| Is This Answer Correct ? | 26 Yes | 3 No |
Post New Answer View All Answers
WHICH TYPE OF JOBS WE GET BY WRITING GROUPS .WHEN THE EXAMS CONDUCTED IS THIS EXAMS ARE CONDUCTED EVERY YEAR OR NOT.PLS TELL ME THE ANSWER
Write a C program in Fibonacci series.
Do character constants represent numerical values?
A collection of functions,calls,subroutines or other data a) library b) header files c) set of files d) textfiles
What is c language & why it is used?
What is pointers in c?
How can I prevent another program from modifying part of a file that I am modifying?
What is the modulus operator?
What is break statement?
What is the use of function in c?
what is the basis for selection of arrays or pointers as data structure in a program
How does selection sort work in c?
Want to know how to write a C program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.
Write a program to replace n bits from the position p of the bit representation of an inputted character x with the one's complement. Method invertBit takes 3 parameters x as input character, p as position and n as the number of positions from p. Replace n bits from pth position in 8 bit character x. Then return the characters by inverting the bits.
Why header file is used in c?