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
What are the 5 elements of structure?
Explain how do you determine a file’s attributes?
What are the disadvantages of c language?
How can you determine the size of an allocated portion of memory?
Give me the code of in-order recursive and non-recursive.
What is dynamic variable in c?
How can I get back to the interactive keyboard if stdin is redirected?
#include
What is static function in c?
By using C language input a date into it and if it is right?
What do you mean by scope of a variable in c?
How does pointer work in c?
What should malloc(0) do? Return a null pointer or a pointer to 0 bytes?
What is the difference between memcpy and memmove?
Explain what does the characters 'r' and 'w' mean when writing programs that will make use of files?