How can u swap 2 variables in C without using 3rd variable?

Answers were Sorted based on User's Feedback



How can u swap 2 variables in C without using 3rd variable?..

Answer / sj

main()
{
int a=20,b=30;
clrscr();
a=a+b;
b=a-b;
a=a-b;
printf("%d%d",a,b);
getch();
}

Is This Answer Correct ?    38 Yes 4 No

How can u swap 2 variables in C without using 3rd variable?..

Answer / deepa

main()
{
int a=20,b=30;
clrscr();
b=a+b;
a=b-a;
b=b-a;
printf("%d%d",a,b);
getch();
}

Is This Answer Correct ?    5 Yes 4 No

How can u swap 2 variables in C without using 3rd variable?..

Answer / rahul

#include<stdio.h>
#include<conio.h>
void main()
{
int a=20,b=30,c;
clrscr();
a=a+b;
b=b+a;
c=a+b;
c=b-a;
printf("swapping two variables using 3rd variable");
scanf("%d%d%d,a,b,c);
getch();
}

Is This Answer Correct ?    2 Yes 8 No

Post New Answer

More Manual Testing Interview Questions

what all the metrics to be checked for a document ?

1 Answers   Bally Technologies,


How we will do Memory Testing? There is any tool to do that testing and to whome this testing to be performed?

0 Answers  


Explain all kinds of testing?

2 Answers  


what a tester test in unit testing,,, explan in details...

3 Answers  


How do we find Effectiveness of Test Cases..Thanks in advance...

4 Answers   Siemens,






Hi Everybody could you please send me the ISTQB Material to my mail id sravanthireddyr@gmail.com Thanking you in advance

1 Answers   QA,


What are the test methodologies??

10 Answers   Accenture,


What is 'Account Conditioning'?

0 Answers   TSYS,


What is the usability test case for yahoo login page

4 Answers   Global Logic,


There is an help option in one window, which consists of 100 pages. I want to test one word from every page. How can I do this in 5 minutes?

2 Answers   DELL, IBM,


i have sanity,smoke,regression and retesting.what is the right order of these in testing process.plz ans with example its urgent. vikas_singh@live.com

3 Answers  


what is white box testing and what is the teckniques

2 Answers   Wipro,


Categories