swap two number wthout using third variable
Answers were Sorted based on User's Feedback
Answer / jvhariharan
void main()
{
int a=10,b=20;
a=a+b;
b=a-b;
a=a-b;
}
Is This Answer Correct ? | 24 Yes | 3 No |
Answer / ashutosh tiwari
void swap_num(int *a, int *b)
{
*a = *a+*b; *b = *a-*b; *a = *a-*b;
}
or
void swap_num(int *a,int *b)
{
*a = *a^*b; *b = *a^*b; *a = *a^*b;
}
Is This Answer Correct ? | 8 Yes | 0 No |
Answer / suyog
A very simple and cute answer...
Assign as follows
a=a+b-(b=a)
Is This Answer Correct ? | 6 Yes | 0 No |
Answer / abhay khare
void main()
{
int a,b,c
printf("two no are\n");
scanf("%d&n");
a=c;
b=a
c=b
getch;
}
Is This Answer Correct ? | 1 Yes | 10 No |
how many types of operating system are avaliable?
Plz sent me in .net 2.0 interview Question & answers?
how to study PHP my own? i reffered many sites.. but as being a fresher i couldnt follow those... which site will be the best one?
Define Abstract method & class with Example
what is lazy loading in hibernate?Explain in detailed manner?
Write a shell program. Enter basic pay of an employee and calculate DA, HRA, Deduction, Gross pay and Net pay as follows: DA = 75 % of BASIC HRA = 10 % of BASIC DEDUCTION = 15 % of BASIC GROSS PAY = BASIC+DA+HRA NET PAY = GROSS PAY-DEDUCTION.
Which method protects back button to retrieve old value from previous page in Struts.
what is client server & server? What r types of Joins? explsin it! which types of indexex in sql server? what is triggers?
what are resources in case of Threads
£¢®£ž›;=9:B9<::C = ADITHI HOW TO GET?
1.What is difference between symget and & in sas? 2.what is difference between callsymput and %let?
10.Define filters,binary to hexadecimal,hexadecimal to decimal?