write a program to swap Two numbers without using temp variable.
Answer Posted / dally
#include<stdio.h>
int main()
{
int a,b;
printf("Enter values for a,b\n");
scanf("%d %d",&a,&b);
b = b+a;
a= b-a;
b=b-a;
printf("a = %d,b = %d",a,b);
}
| Is This Answer Correct ? | 18 Yes | 11 No |
Post New Answer View All Answers
What is the difference between union and structure in c?
why programs in c are running with out #include
What is line in c preprocessor?
Why is structure padding done in c?
How do you do dynamic memory allocation in C applications?
What is the argument of a function in c?
Explain how can I open a file so that other programs can update it at the same time?
What are pointers? What are stacks and queues?
Explain what is the difference between the expression '++a' and 'a++'?
Once I have used freopen, how can I get the original stdout (or stdin) back?
What is your stream meaning?
What is the size of a union variable?
Why is c used in embedded systems?
1.int a=10; 2.int b=20; 3. //write here 4.b=30; Write code at line 3 so that when the value of b is changed variable a should automatically change with same value as b. 5.
What is a stream?