swapping of two numbers without using third variable using
AND and OR operators
Answers were Sorted based on User's Feedback
Answer / ramesh reddy
a = a^b; b =a^b; a =a^b;
or
a=a+b; b=a-b; a=a-b;
Is This Answer Correct ? | 43 Yes | 2 No |
however we can implement using EXoR , where it is made of
AND and OR gate too....
x=90;
y=51;
x^=y^=x;
the value of x & y will be swapped.
Is This Answer Correct ? | 8 Yes | 8 No |
4)What would be the output? main() { int num=425; pf("%d",pf("%d",num)); } a)Comp error b)4425 c)4253 d)3435 e)none
What is #define used for in c?
Why are all header files not declared in every c program?
If one class contains another class as a member, in what order are the two class constructors called a) Constructor for the member class is called first b) Constructor for the member class is called second c) Only one of the constructors is called d) all of the above
20. main() { int i=5; printf("%d%d%d%d%d%d",i++,i--,++i,--i,i); } Answer:??????
State the difference between x3 and x[3].
Do you know the use of 'auto' keyword?
difference of two no's with out using - operator
What is an array? What the different types of arrays in c?
What are the 32 keywords in c?
where can function pointers be used?
hai iam working in sap sd module for one year and working in lumax ind ltd in desp department but my problem is i have done m.b.a in hr/marketing and working sap sd there is any combination it. can you give right solution of my problem. and what can i do?