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
Why is c called c not d or e?
What is #ifdef ? What is its application?
What functions are in conio h?
Why c is a mother language?
What is scanf () in c?
A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream
Can you write the algorithm for Queue?
What is the default value of local and global variables in c?
how to capitalise first letter of each word in a given string?
What is assert and when would I use it?
What does sizeof return c?
What would be an example of a structure analogous to structure c?
What is stack in c?
What are the two types of structure?
How variables are declared in c?