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. How many jobs can we write in a single file? 2. How many maximum members can exist in a single partition data set(pds) in jcl?
Define distributed queries. can you explain me as soon as possible
How to know we are in home page of a web application using QTP
diffrence between oracle apps , .NET , SAP
smal talk is pure object oriented or not?
whats the Need for Concurrency control
Given n red balls and m blue balls and some containers, how would you distribute those balls among the containers such that the probability of picking a red ball is maximized, assuming that the user randomly chooses a container and then randomly picks a ball from that.
Tag for turning an image into a hyperlink is
Why we use NEW operator when we create Object,While in C++ we donot ?
how can we maintain the previous version scripts to new version.
0 Answers DST Global Solutions,
Write a program to find whether a given number is prime or not.
hi friends please tel me how to handle the recovery manager(All i.e PopUp ,Application Crach ,Object state,etc) in QTP