Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace ConsoleApp2
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.Write("The value of the 1st variable: ");//request the first number from the command screen
- int a =Int32.Parse(Console.ReadLine());//takes the first number entered
- Console.Write("The value of the 2nd variable: ");//request the second number from the command screen
- int b= Int32.Parse(Console.ReadLine());//takes the second number entered
- a = a + b;//sum the number of a and the number b
- b = a - b;//subtract the number b from the total and find the first number a and save it to b
- a = a - b;//subtract the number b from the total and find the first number b and save it to a
- Console.WriteLine("---------------------------------------");//spacing
- Console.WriteLine("The value of the 1st variable: "+a);//write the Changing the number a
- Console.WriteLine("The value of the 2st variable: "+b);//write the Changing the number b
- Console.Write("Press a key to close the application");// to show the result of the program on console
- Console.ReadKey();//after presiing a key close the program
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement