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 are loops in c?
How many data structures are there in c?
How can I insert or delete a line (or record) in the middle of a file?
Why string is used in c?
What are the differences between new and malloc in C?
Is c++ based on c?
What is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?
What is the usage of the pointer in c?
What is the use of linkage in c language?
what is the structure pointer?
a=10;b= 5;c=3;d=3; if(a printf(%d %d %d %d a,b,c,d) else printf("%d %d %d %d a,b,c,d);
What is abstract data structure in c?
What are linked lists in c?
How can I read/write structures from/to data files?
Why do we use c for the speed of light?