answersLogoWhite

0


Best Answer

temp = x;

x = y;

y = temp;

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Program to exchange the value x and y using 3 variables?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What are the advantages of using pointers in a program?

pointers points to the memory address of another variable.....in functions we have two kind of variables the actual and dummy variable. when we operate on variables..the value of dummy variables are effected, but if we want to make changes in the actual variable then we have to refer to their address..and we can reach to address of the variables by only using pointers.


How do you evaluate in mathematics?

Evaluate means find the value of.To evaluate an expression, if there are any variables replace them by their values. Then, using BIDMAS/PEMDAS, calculate the value of the expression.Evaluate means find the value of.To evaluate an expression, if there are any variables replace them by their values. Then, using BIDMAS/PEMDAS, calculate the value of the expression.Evaluate means find the value of.To evaluate an expression, if there are any variables replace them by their values. Then, using BIDMAS/PEMDAS, calculate the value of the expression.Evaluate means find the value of.To evaluate an expression, if there are any variables replace them by their values. Then, using BIDMAS/PEMDAS, calculate the value of the expression.


How are constants and variables different?

Constants are values that remain constant and cannot be changed once they are assigned a value. Variables, on the other hand, can have different values assigned to them and their value can be changed throughout the program. Constants provide a fixed value, while variables provide flexibility and allow for changes in value.


Why are public instance variable dangerous?

Public instance variables are not dangerous, but can put your program at risk of being hacked. For instance, say the variable bacon is an integer that represents your health in a game, and its value is 50. Someone could change its value to 1,000,000 by using a program called a decompiler, then change the code, and recompile it.


How do you write a program in c to swap two variables without using the add and multiplication?

int varA, varB; int tmp; // common way to swap 2 variables in the same type; tmp = varA; // store the original value of varA varA = varB; // assign A with B varB = tmp; // B now has the original value of varA


What are continuous and discrete variables?

the value of variables is determined by the equation, discrete variables have absolute single value while the continuos have a range value


What does the value of an expression mean?

If you replace variables in an expression by numbers (in case there are any variables) and then do the indicated operations, you get a number. That final number is the "value" of the expression.


What is constant variables?

Variables are items, which change their values during the execution of a program. Constants do not change the value during the execution of a program.


Is eliminating variables from equations equal to find the value of the variables?

No, but eliminating variables is one of several ways to find the value of variables in a system of equations.


Write a program using recursion which should take two values and display 1st value raised to the power of second value?

Write a program using recursion which should take two values and display 1st value raised to the power of second value.


What is called when a data value appears directly in a statement?

It can be called hard coding the data. For many things in computing it should be avoided if possible in favour of using variables or defined constants, in order to give more flexibility and structure to a program.


When using goal seek command how many input variables can you change at a time?

Just one value can be changed.