Write a program to interchange two variables without using
the third variable?
Answer Posted / satish
#include<stdio.h>
void main()
{
int x,y;
printf("enter x and y: ");
scanf("%d%d",&x,&y);
x^=y^=x^=y;
printf("elements after swapping: %d,%d\n",x,y);
}
| Is This Answer Correct ? | 20 Yes | 26 No |
Post New Answer View All Answers
Write programs for String Reversal & Palindrome check
.find the output of the following program? char*myfunc(char*ptr) { ptr +=3; return (ptr); } int main() { char*x,*y; x="HELLO"; y=myfunc(x); printf("y = %s ",y); return 0; }
Can a program have two main functions?
Explain the properties of union.
#include
How do I get an accurate error status return from system on ms-dos?
c language supports bitwise operations, why a) 'c' language is system oriented b) 'c' language is problem oriented c) 'c' language is middle level language d) all the above
What do you mean by invalid pointer arithmetic?
Describe explain how arrays can be passed to a user defined function
Why do we use main function?
There seem to be a few missing operators ..
What is an lvalue?
How can I swap two values without using a temporary?
What is C language ?
What do the functions atoi(), itoa() and gcvt() do?