wat are the two methods for swapping two numbers without
using temp variable??
Answers were Sorted based on User's Feedback
Answer / shrikantauti
i dont know the methods but can give the code to swap values without temporary variable.
a b
a=a+b
b=a-b
a=a-b
Is This Answer Correct ? | 6 Yes | 0 No |
Why we use void main in c?
What is hashing in c?
How to add two numbers without using arithmetic operators?
18 Answers College School Exams Tests, e track, Infosys, Pan Parag, Sapient, TCS,
What are Macros? What are its advantages and disadvantages?
What is a function simple definition?
What is extern variable in c with example?
int i=10; printf("%d %d %d", i, i=20, i);
disadvantages of realloc ?
What is main function in c?
what are the languages used in c#?
where do we use volatile keyword?
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.