Yamentou

Untitled

Sep 10th, 2020
1,263
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /******************************************************************************
  2.  
  3. Welcome to GDB Online.
  4. GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
  5. C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
  6. Code, Compile, Run and Debug online from anywhere in world.
  7.  
  8. *******************************************************************************/
  9. using System;
  10. class HelloWorld
  11. {
  12.   static void Main ()
  13.   {
  14.     Console.WriteLine ("Please provide a number for x: ");
  15.     int x = Convert.ToInt32 (Console.ReadLine ());  //Creating a variable x and storing a number into it
  16.  
  17.       Console.WriteLine ("Please provide another number for y.");
  18.     int y = Convert.ToInt32 (Console.ReadLine ());  //Creating a variable y and storing a number into it
  19.  
  20.     //z is a variable created to contain the result of the sum of x + y
  21.     int z = x + y;
  22.  
  23.       Console.WriteLine ("The total of the addition is: " + z);
  24.  
  25.       Console.WriteLine ("What is your username?");
  26.     //string username = "AudielV"; //Here the username is fixed
  27.     string username = Console.ReadLine ();
  28.  
  29.       Console.WriteLine ("Welcome " + username);    //Concatenation is putting two or more strings together
  30.       Console.WriteLine ("We are about to do comparison: ");
  31.  
  32.     if (x > y)
  33.       {
  34.     Console.
  35.       WriteLine ("The number in x is greater than the number in y.");
  36.       }
  37.     else
  38.       {
  39.     Console.
  40.       WriteLine ("The number in x is smaller than the number in y.");
  41.       }
  42.   }
  43. }
  44.  
  45. /* Every C# program has a Main() method, which is where
  46. the program starts executing from */
  47.  
  48. //Console.WriteLine("ABC") is used to display on screen.
  49. //C# statements end in semi colon (;)
  50. //C# is CaSE Sensitive
  51.  
RAW Paste Data