Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...

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

Answer Posted / ramesh mca gprec knl

#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 ?    1 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why shouldn’t I start variable names with underscores?

231


What is null pointer in c?

238


a construct the"else" part of "if" statement contains anoth "if else" statement is called a) if-else b) else-if-else c) if-else-if-else d) chain if/if-else-if

249


Why enum is used in c?

197


Where is volatile variable stored?

186






What is volatile variable how do you declare it?

183


What is the difference between int main and void main?

200


a) Identify the following declarations. Ex. int i (integer variable) float a[l0](array of 10 real nos) int (*f())() void *f int (*f()) [] void *f int f[] [] [] char *(*f) () int (*f[]) [] float(*f) [] [] float **f int ******f

1181


What is the purpose of main() function?

238


What are lookup tables in c?

173


Why is c so powerful?

205


How will you find a duplicate number in a array without negating the nos ?

1235


Which header file should you include if you are to develop a function which can accept variable number of arguments?

321


write a program to find the given number is prime or not

3008


the expression a=30*1000+2768; evalutes to a) 32768 b) -32768 c) 113040 d) 0

785