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 are the Defect Life Cycle?

2 Answers   Fidelity,


tell me some gud sites for testing??

2 Answers  


1.The main purpose of integration testing is to find design errors.is it true 2.The testing technique that requires devising test cases to demonstrate that each program function is operational is called ?

2 Answers  


entry criteria and exit criteria for unit testing, integration testing, system testing and uat

1 Answers  


Is Anyone attended the manual testing interview with capgemini in recent past. please let me know the type of questions they can ask. Thanks

1 Answers  


Guys, can any one of u give the realtime example for Performance Testing

1 Answers  


Is it possible that there can be number of test cases? Mean to say 500 or 1000 test cases? Reply me as early as possible.

3 Answers  


Give example for usability testing ?

4 Answers  


what r the different types of test case? and tell me the names.

5 Answers   Object Orb, Synova Inc,


what methodologies you are following

6 Answers   Wipro,


Just now i got a bug in the application.Anyone of u can clarify me is it a bug or not. scenario is: 1. if we a check box more than one. 2. click TAB and keep the focus on any check box not on the last check box 3. Then click (space+tab) at a time 4. then check the changes if we click anywhere the previous check box is going to be checked and the application is going to be hanged........... please answer to this question.If i have reported this to my developers they are telling that this is a browser property please confirm this scenario at ur developers and answer to me please .thanks in advance........ (glamorous)

2 Answers  


can anyone tell anyone is providing training for CSTE exam in bangalore? and can u send some links related to this?

1 Answers  


Categories