write a program to swap Two numbers without using temp variable.
Answer Posted / tchoephel
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
printf("enter two nos A and B\n");
scanf("%d%d",a,b);
printf("before swaping A=%d\n B=%d\n",a,b);
a=a+b:
b=a-b;
a=a-b;
prinf("after swaping A=%d\n B=%d\n",a,b);
getch();
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What are local static variables? How can you use them?
What is the difference between array and pointer in c?
What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.
What do you mean by invalid pointer arithmetic?
What is the purpose of ftell?
Why is sizeof () an operator and not a function?
What are structural members?
How can you call a function, given its name as a string?
Where register variables are stored in c?
What is a pointer in c?
Explain logical errors? Compare with syntax errors.
How do you use a pointer to a function?
Explain that why C is procedural?
What is the role of this pointer?
Difference between macros and inline functions? Can a function be forced as inline?