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 |
Which command is more efficient? *(ptr+1) or ptr[1]
errors in computer programmes are called
main() { struct test { char c; int i; char m; } t1; printf("%d %d\n", sizeof(t1), sizeof(t1.c)); }
1 Answers Vector, Vector India,
What does a run-time "null pointer assignment" error mean?
What is macro?
Write a program to know whether the input number is an armstrong number.
what is a void pointer?
how to print "hai" in c?
int a=1,b=2,c=3; printf("%d,%d",a,b,c); What is the output?
What is an expression?
Why is sprintf unsafe?
What are the applications of c language?