How many ways are there to swap two numbers without using
temporary variable? Give the each logic.
Answer Posted / kishan gowda
One more method its bit complicated from the people from
the non electronics background......
void main()
{
pf(" a and b ");
sf("%d %d", &a, &b);
a= a^b;
b= b^a;
a= a^b;
pf("Swapped no's are a=%d and b=%d" ,a ,b);
}
| Is This Answer Correct ? | 24 Yes | 4 No |
Post New Answer View All Answers
Can include files be nested? How many levels deep can include files be nested?
What is unary operator?
Input is "rama loves rajesh and rajesh Loves rama also and rajesh wear gloves and bloves" To print output is count the numbers of times repeted the word love without case sensitive.
What’s the special use of UNIONS?
What is main () in c language?
How can I dynamically allocate arrays?
What is double pointer in c?
What's the difference between constant char *p and char * constant p?
What is wrong in this statement?
What are the types of data types and explain?
In c programming typeing to occupy the variables in memory space. if not useing the variable the memory space is wasted.ok, how to avoid the situation..? (the variable is used & notused)
write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.
Is that possible to add pointers to each other?
What are register variables in c?
Distinguish between actual and formal arguments.