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 the usage of the pointer in c?
Write a program to compute the similarity between two strings - The program should get the two strings as input - Then it will output one single number which is the percentage of similarity between the two strings
What is the data segment that is followed by c?
The process of repeatedly running a set of computer instructions until some condition is specifed a) condition b) sequential condition c) global d) iteration
How to define structures? ·
Is c is a low level language?
What is getche() function?
How can I invoke another program (a standalone executable, or an operating system command) from within a c program?
What is variable in c example?
Some coders debug their programs by placing comment symbols on some codes instead of deleting it. How does this aid in debugging?
write a c programming using command line argument,demonstrate set operation(eg;union,intersection,difference) example output is c:>setop 12 34 45 1 union 34 42 66 c:>setop 12 34 1 42 66 c:>setop 12 34 diff 12 56 67 78 setop 12 34
What is the difference between declaring a variable and defining a variable?
Write the Program to reverse a string using pointers.
Difference between Shallow copy and Deep copy?
What does int main () mean?