Advertisement
furkankahraman18

PI Works Technical Questionnaire - SW Support

Mar 19th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.25 KB | None | 0 0
  1. namespace ConsoleApp2
  2. {
  3.     class Program
  4.     {
  5.         static void Main(string[] args)
  6.         {
  7.             Console.Write("The value of the 1st variable: ");//request the first number from the command screen
  8.             int a =Int32.Parse(Console.ReadLine());//takes the first number entered
  9.             Console.Write("The value of the 2nd variable: ");//request the second number from the command screen
  10.             int b= Int32.Parse(Console.ReadLine());//takes the second number entered
  11.             a = a + b;//sum the number of a and the number b
  12.             b = a - b;//subtract the number b from the total and find the first number  a and save it to b
  13.             a = a - b;//subtract the number b from the total and find the first number b and save it to a
  14.             Console.WriteLine("---------------------------------------");//spacing
  15.             Console.WriteLine("The value of the 1st variable: "+a);//write the Changing the number a
  16.             Console.WriteLine("The value of the 2st variable: "+b);//write the Changing the number b
  17.             Console.Write("Press a key to close the application");// to show the result of the program on console
  18.             Console.ReadKey();//after presiing a key close the program
  19.         }
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement