Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Problem 10. Exchange Variable Values
- //Declare two integer variables a and b and assign them with 5 and 10 and after that exchange their values. Print the variable values before and after the exchange.
- using System;
- class ExchangeVariableValues
- {
- static void Main()
- {
- int a = 5;
- int b = 10;
- int c;
- c = a;
- a = b;
- b = c;
- Console.WriteLine("a = {0} and b = {1}", a, b);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement