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


Please Help Members By Posting Answers For Below Questions

What is an lvalue?

627


What is the use of in c?

574


Who invented bcpl language?

698


How is null defined in c?

650


Explain logical errors? Compare with syntax errors.

618






Differentiate between ordinary variable and pointer in c.

613


Do you know what are the properties of union in c?

577


What is the condition that is applied with ?: Operator?

656


What is volatile c?

520


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

643


4. main() { int c=- -2; printf("c=%d",c); }

1364


What is a sequential access file?

644


what are the different storage classes in c?

660


What is storage class?

654


Is the exit() function same as the return statement? Explain.

656