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

Answer Posted / raghavendra

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

Is This Answer Correct ?    6 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Under what circumstances does a name clash occur?

678


Why is it usually a bad idea to use gets()? Suggest a workaround.

888


Distinguish between actual and formal arguments.

579


Write a program to print fibonacci series using recursion?

577


Program will then find the largest of three numbers using nested if-else statements. User is prompted to enter three numbers. Program will find the largest number and display it on the screen. All three numbers entered by the user are also displayed. If user enters 21, 33, and 5, the output should be as follows: You entered: 21, 33 and 5. The largest number is 33.

1008






GIven a sequence of characters. How will you convert the lower case characters to upper case characters. ( Try using bit vector - sol given in the C lib -> typec.h)

673


What is bss in c?

592


What is c definition?

733


What is oops c?

596


What is a spanning Tree?

935


Explain what is wrong in this statement?

623


What is the use of putchar function?

642


What is table lookup in c?

616


Explain setjmp()?

644


What are pragmas and what are they good for?

565