How can u swap 2 variables in C without using 3rd variable?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
diff b/w waterfall model & spiral model?
14 Answers APIIT, BBD, QQ, Rift Valley Institute of Science and Technology RVIST, Wipro,
Explain the difference between alpha testing and beta testing.
what does a test plan contains and is a tester allowed to see the entire test plan or only the scheduling part of the test plan
What are techniques for Integration Testing.
In the place of button developer use image, during the tab movements image(button) is not highlighted is it bug or not?
Difference between regression testing and re-testing
Give an example of test policy?
Among 5000 test cases, how to pick test cases for regression testing
Why Should we prepare traceability matrix?
I need a Test case templetes for Yahoo Mail ID
What is the difference between Functional requirement and business requirements?
What is the difference between Monkey testing an Ad-hoc testing (If ur answer is same, then why we need two names)
6 Answers CFC, CTS, PRO, Protech,