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 an lvalue?
What is the use of in c?
Who invented bcpl language?
How is null defined in c?
Explain logical errors? Compare with syntax errors.
Differentiate between ordinary variable and pointer in c.
Do you know what are the properties of union in c?
What is the condition that is applied with ?: Operator?
What is volatile c?
An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above
4. main() { int c=- -2; printf("c=%d",c); }
What is a sequential access file?
what are the different storage classes in c?
What is storage class?
Is the exit() function same as the return statement? Explain.