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
if a is an integer variable, a=5/2; will return a value a) 2.5 b) 3 c) 2 d) 0
What is meant by realloc()?
why programs in c are running with out #include
to find the closest pair
What are the functions to open and close file in c language?
What is structure in c language?
What is Dynamic memory allocation in C? Name the dynamic allocation functions.
What is structure padding and packing in c?
What is void main () in c?
What are the advantages of union?
What happens if you free a pointer twice?
any C program contains only one function, it must be a) void () b) main () c) message () d) abc ()
What is the difference between test design and test case design?
any limit on the number of functions that might be present in a C program a) max 35 functions b) max 50 functions c) no limit d) none of the above
What is the difference between c and python?