write a program to swap Two numbers without using temp variable.
Answer Posted / kabita shah
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int x,y;
printf("enter two value");
scanf("%d%d",&x,&y);
x=x+y;
y=x-y;
x=x-y;
printf("value of x=%d",x);
printf("value of y=%d",y);
getch();
}
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is data type long in c?
Write a simple code fragment that will check if a number is positive or negative.
What is a null pointer assignment error? What are bus errors, memory faults, and core dumps?
while initialization of array why we use a[][2] why not a[2][]...?
What is the difference between printf and scanf in c?
How can I read a binary data file properly?
What are the benefits of organizational structure?
What is the difference between far and near ?
Suggesting that there can be 62 seconds in a minute?
What is pointer & why it is used?
writ a program to compare using strcmp VIVA and viva with its output.
Explain what is the difference between the expression '++a' and 'a++'?
What is meant by high-order and low-order bytes?
what is the syallabus of computer science students in group- 1?
How can I find out how much free space is available on disk?