Write a program to interchange two variables without using
the third variable?

Answer Posted / deepa.n

#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=b/a;
printf("After chanching no is =\n");
printf("a=%d b=%d",a,b);
getch();
}

Is This Answer Correct ?    15 Yes 26 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many levels of pointers can you have?

689


What is character set?

675


The number of bytes of storage occupied by short, int and long are a) 2, 2 and 4 b) 2, 4 and 4 c) 4, 4 and 4 d) none

750


Write an algorithm for implementing insertion and deletion operations in a singly linked list using arrays ?

3039


Why enum is used in c?

509






How can I pad a string to a known length?

601


What does p mean in physics?

573


What is the use of header files?

585


What is an operator?

648


Explain what are its uses in c programming?

581


what is the function of pragma directive in c?

602


How important is structure in life?

574


Explain how do you convert strings to numbers in c?

582


What is the meaning of && in c?

537


Explain is it valid to address one element beyond the end of an array?

717