How many ways are there to swap two numbers without using
temporary variable? Give the each logic.
Answer Posted / chandan doki
void main()
{
int a,b;
printf("eneter any two values for a and b");
scanf("%d%d",&a,&b);
b=a+b;
a=b-a;
b=b-a;
printf("a=%d\nb=%d",a,b);
getch();
}
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
When can a far pointer be used?
What is the difference between fread buffer() and fwrite buffer()?
What is pass by value in c?
Difference between Function to pointer and pointer to function
What is a lookup table in c?
Explain how can I convert a number to a string?
What does it mean when a pointer is used in an if statement?
How can you determine the size of an allocated portion of memory?
What is the argument of a function in c?
If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?
What does the function toupper() do?
How can you increase the allowable number of simultaneously open files?
Write a program to print factorial of given number using recursion?
What is sizeof int in c?
Are c and c++ the same?