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 are the types of c language?
Differentiate abs() function from fabs() function.
what is the difference between north western polytechnique university and your applied colleges?? please give ur answers for this. :)
What is signed and unsigned?
What is ambagious result in C? explain with an example.
What is #define used for in c?
Is main is user defined function?
Is c++ based on c?
What is bash c?
Place the #include statement must be written in the program?
What is maximum size of array in c?
What are the different types of constants?
What is the use of getchar() function?
Can you return null in c?
a value that does not change during program execution a) variabe b) argument c) parameter d) none