Write a program to interchange two variables without using
the third variable?
Answer Posted / mahendra giri
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
printf("Enter two no");
scanf("%d%d",&a,&b);
c=a+b;
b=a-b;
a=a-b;
printf("After chanching no is =\n");
printf("a=%d b=%d",a,b);
getch();
}
| Is This Answer Correct ? | 23 Yes | 44 No |
Post New Answer View All Answers
What is a function in c?
How many levels of indirection in pointers can you have in a single declaration?
What is difference between constant pointer and constant variable?
Why c is faster than c++?
develop algorithms to add polynomials (i) in one variable
What is the correct declaration of main?
p*=(++q)++*--p when p=q=1 while(q<=6)
Explain the difference between getch() and getche() in c?
What are terms in math?
An instruction which is analysed and acted upon by the processor prior to the compiler going its work a) directive b) constructive c) constant d) absolute mode
What is const keyword in c?
Are negative numbers true in c?
Does c have circular shift operators?
What are the different types of objects used in c?
Why do we use & in c?