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;
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 ?    8 Yes 14 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how can I convert a string to a number?

632


How are structure passing and returning implemented?

583


What is the difference between text files and binary files?

663


I need a sort of an approximate strcmp routine?

647


What happens if you free a pointer twice?

594






What is the difference between c &c++?

635


What’s a signal? Explain what do I use signals for?

593


What is the benefit of using const for declaring constants?

575


Dont ansi function prototypes render lint obsolete?

593


Is it better to use a macro or a function?

640


What is volatile c?

509


What is hungarian notation? Is it worthwhile?

683


write a program to find out prime number using sieve case?

1626


Array is an lvalue or not?

622


What is array within structure?

574