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 |
1.What is difference between symget and & in sas? 2.what is difference between callsymput and %let?
pleasew define carrier scope in abap (sap).
how much fee for deccan soft institute .how to block seat for sandeep sir class reply soonnnn
DIFFERENCE BETWEEN BINDING LANG AND BIND DIR WHEN USING IN SERVICE PGM
What are events in smartforms?
can we retrieve only integer/String type columns from a table,if yes how?
How to swap values between two variables without using a third variable?
24 Answers HCL, TCS,
hai i am prasanna.I am MCA 2009 fresher.tell me about certifications.which certification helps me to improve my carrier and to get a technically oriented job ,which certification helps to get job faster.
Define distributed queries. can you explain me as soon as possible
9.Difference between even and odd signals?explain with the diagram?
What is diffrent between Method and and function in c#
What is Negative testing?