Write a program to interchange two variables without using
the third variable?
Answer Posted / jisha. k.a
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf("Enter two no");
scanf("%d%d",&a,&b);
a=a-b;
b=a+b;
a=b-a;
printf("After chanching no is =\n");
printf("a=%d b=%d",a,b);
getch();
}
| Is This Answer Correct ? | 34 Yes | 16 No |
Post New Answer View All Answers
What is default value of global variable in c?
What is typedef example?
explain what are actual arguments?
Which are low level languages?
what is bit rate & baud rate? plz give wave forms
What is null pointer constant?
The performance of an operation in several steps with each step using the output of the preceding step a) recursion b) search c) call by value d) call by reference
Which header file is essential for using strcmp function?
What are void pointers in c?
What is the difference between %d and %i?
Should I learn data structures in c or python?
How can I implement a delay, or time a users response, with sub-second resolution?
What is wrong with this declaration?
How #define works?
Create a simple code fragment that will swap the values of two variables num1 and num2.