wat are the two methods for swapping two numbers without
using temp variable??
Answers were Sorted based on User's Feedback
Answer / vijayakumar kanagasabai
main()
{
int a=4;b=6;
printf("Before swapping: a=%d, b=%d",a,b);
a=a+b;
b=a-b;
a=a-b;
printf("After swapping: a=%d, b=%d",a,b);
}
Is This Answer Correct ? | 11 Yes | 1 No |
Answer / saida
int a=4,b=6;
printf("Before swapping: a=%d, b=%d",a,b);
a=a^b;
b=a^b;
a=a^b;
printf("After swapping: a=%d, b=%d",a,b);
}
Is This Answer Correct ? | 2 Yes | 0 No |
What are the advantages of using Unions?
Explain the concept and use of type void.
main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }
What is function prototype?
What is variable in c with example?
What is operator promotion?
How to swap two values using a single variable ? condition: Not to use Array and Pointer ?
program to locate string with in a string with using strstr function
Is null equal to 0 in sql?
DIFFERNCE BETWEEN THE C++ AND C LANGUAGE?
what is difference between getchar,putchar functions and printf and scanf function? does putchar show output only when input given to it
how to set Nth bit of variable by using MACRO