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