Write a program to interchange two variables without using
the third variable?
Answer Posted / vijay r15
using many ways we can
perform
#include<stdio.H>
void main()
{
int a=10,b=20;
b=a+b-(a=b);
//or use a^=b^=a^=b;
//or use a=a+b;b=a-
b;a=a-b;
//or use a^=b; b^=a;
a^=b;
printf("%d%d",a,b);
}
Is This Answer Correct ? | 2 Yes | 5 No |
Post New Answer View All Answers
What are types of structure?
main() { printf("hello"); fork(); }
What is the best way of making my program efficient?
What are the advantage of c language?
Explain null pointer.
What are variables and it what way is it different from constants?
What is volatile c?
Tell me the use of bit field in c language?
Is main is user defined function?
When can you use a pointer with a function?
What is a loop?
write a program that types this pattern: 12345678987654321 12345678 87654321 1234567 7654321 123456 654321 12345 54321 1234 4321 123 321 12 21 1 1
What are global variables?
Can we access the array using a pointer in c language?
If jack lies on Mon, Tue Wed and jill lies on Thursday, Friday and Saturday. If both together tell they lied yesterday. So c the given options and then c cos in the given dates one will be saying the truth and one will be lying. I got Thursday as option because jack is saying the truth he lied yest but jill is lying again as he lies on that day.