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

How to test an application if it was already developed and it is in the state of changing the functionality according to the customer requirement How to start testing in this situation. I got an application to test.It is a desktop application.It is still developing and started 8 months back.how can i start to test this application? Is it the right way to test it in "Random testing"? or writing the testcases from page one and executing them.i have an another responsibility that is I have to automate that application. can anyone tell me what is the process to test this application.

0 Answers  


Explain scrum process

1 Answers  


What Defect Density?

2 Answers  


can u plz give an example for regression testing with example.

2 Answers  


What is Standalone testing?

10 Answers   Accenture,


What did you include in a test plan?

2 Answers  


what is diff between stress & load testing

8 Answers   Sonata,


What will be the QA roles and responsibilities in Health care stream like BCBS,can someone please explain me any example project regarding health care services in web-based application?

0 Answers  


How do you scope,organise and execute a test project.

0 Answers   Synechron,


Login page contains, Username , Password ,OK Button and CANCEL Button.If i click on OK button,cancel functionality is working and if i click on CANCEL Button,OK Functionality is working.In this case what is the level of priority (HIGH/MEDIUM/LOW) and level of SEVERIOTY (HIGH/MEDIUM/LOW)? Give the reason ,explain clearly?

3 Answers   ITC Infotech,


in compatability and installation testings ,which one is conducted or performed on an application initially

1 Answers  


What is the Input of Testcase?

13 Answers   GE,


Categories