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
What are the complete rules for header file searching?
What does c mean in standard form?
What is function pointer c?
What's the difference between constant char *p and char * constant p?
Difference between macros and inline functions? Can a function be forced as inline?
Why is structure padding done in c?
What is wrong with this declaration?
Calculate 1*2*3*____*n using recursive function??
diff between exptected result and requirement?
What is the size of enum in c?
When should a type cast be used?
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.
which is conditional construct a) if statement b) switch statement c) while/for d) goto
Explain why C language is procedural?
write a c program in such a way that if we enter the today date the output should be next day's date.