Write a program to interchange two variables without using
the third variable?
Answer Posted / guest
#include<stdio.h>
void main()
{
int x,y;
printf("enter x and y");
scanf("%d%d",&x,&y);
x=x+y;
y=x-y;
x=x-y;
printf("elements after swapping :%d,%d",x,y);
}
| Is This Answer Correct ? | 185 Yes | 32 No |
Post New Answer View All Answers
How many bytes are occupied by near, far and huge pointers (dos)?
What are comments and how do you insert it in a C program?
What is the scope of static variable in c?
what is bit rate & baud rate? plz give wave forms
write a program to generate address labels using structures?
Should I use symbolic names like true and false for boolean constants, or plain 1 and 0?
What are loops c?
What is static memory allocation?
What is the purpose of the statement: strcat (S2, S1)?
which of the following shows the correct hierarchy of arithmetic operations in C a) (), **, * or/,+ or - b) (),**,*,/,+,- c) (),**,/,*,+,- d) (),/ or *,- or +
What are the Advantages of using macro
How can I convert a number to a string?
What is the size of structure in c?
What is difference between static and global variable in c?
Here is a good puzzle: how do you write a program which produces its own source code as output?