Swap the values of the x and y variables using an intermediate variable. write a program

C # language

int y = 10; // variable y with value 10
int x = 999; // variable x with value 999
int middle; // intermediate variable
Console.WriteLine (“Variable x:” + x + “variable y:” + y); // display the initial values of variables
middle = y; // the intermediate variable is assigned the value of the variable y
y = x; // now we write the value of the variable x to the y variable
x = middle; // and in x we write our saved value y, which is contained in the middle
Console.WriteLine (“Variable x:” + x + “variable y:” + y); // display the results
Console.ReadLine (); // read from the console (otherwise it will not close)



One of the components of a person's success in our time is receiving modern high-quality education, mastering the knowledge, skills and abilities necessary for life in society. A person today needs to study almost all his life, mastering everything new and new, acquiring the necessary professional qualities.