swap two integer variables without using a third temporary
variable?
Answer Posted / sidhartha
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf("\n ENTER 2 VALUES : ");
scanf("%d%d",&a,&b);
printf("\n THE VALUES BEFORE SORTING : %d,%d",a,b);
a=a+b;
b=a-b;
a=a-b;
printf("\n THE VALUES AFTER SORTING : %d,%d",a,b);
getch();
}
| Is This Answer Correct ? | 40 Yes | 1 No |
Post New Answer View All Answers
What is a pointer value and address in c?
Explain how do you sort filenames in a directory?
What is the correct declaration of main?
Explain how can I pad a string to a known length?
Why does the call char scanf work?
How to establish connection with oracle database software from c language?
What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.
Why is %d used in c?
Describe the order of precedence with regards to operators in C.
what is different between auto and local static? why should we use local static?
write a program fibonacci series and palindrome program in c
What is a program?
What is structure in c language?
Explain what are the different file extensions involved when programming in c?
What is the purpose of the preprocessor directive error?