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 |
What is web.configuration? how is it work? & wht is use this?
5. How do you round the addition or subtraction of two numbers in assembler?
1.Mutating table
What function would you use to extract characters from a given string?
Hi All, Can any one please send me the difference between informatica 7i and 8i versions, Thanks in advance. vinod
how we define two jobs have same name??is it exist??
What is the requirement in MIMD ?
What is the effect of the OPTIONS statement ERRORS=1?
3 Answers QSG, Quintiles, SAS,
can we convert .class file to dll file
How do i find out the number of parameters passed into function?
In loading programs into memory, what is the difference between load-time dynamic linking and run-time dynamic linking?
what is jackson structured develepment?? and how is it different from OMT??