Advertisement
wingman007

2018_Programming_C#_BIT_1kurs_PartTime

Dec 11th, 2018
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.64 KB | None | 0 0
  1. using System;
  2.  
  3. namespace HelloKristina
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             Console.WriteLine("Hello World!");
  10.  
  11.             byte myByte = 255;
  12.             sbyte mySByte = -128;
  13.  
  14.             short myShort = 123;// -2^15 2^15 - 1
  15.             ushort myUshort = 65535;
  16.  
  17.             long myLong = -3424523;
  18.             ulong myUlong = 45435;
  19.  
  20.             int age1 = 55;
  21.             int age2 = 18;
  22.             int ageResult;
  23.             ageResult = age1 + age2;
  24.  
  25.             float myFloat = 3.12345645455353453f;
  26.             double myDouble = 12.4353454354353453454353453453453454;
  27.  
  28.             decimal decimalPI = 3.14159265358979323846m;
  29.             Console.WriteLine(decimalPI); // 3.14159265358979323846
  30.  
  31.             Console.WriteLine(myFloat);
  32.             Console.WriteLine(myDouble);
  33.  
  34.  
  35.  
  36.             char myChar = 'P';
  37.             myChar = '\u0041'; // myChar = 'A';
  38.  
  39.             string myString = "Petya";
  40.  
  41.             bool myBool = true; // false | true
  42.  
  43.             // Object myObject = 3;
  44.  
  45.             Console.WriteLine(myChar);
  46.  
  47.             Console.WriteLine(ageResult);
  48.  
  49.             int a = 11;
  50.             int b = 2;
  51.  
  52.             Console.WriteLine(a + b);
  53.             Console.WriteLine(a - b);
  54.             Console.WriteLine(a / b);
  55.             Console.WriteLine(a * b);
  56.             Console.WriteLine(a++);
  57.             Console.WriteLine(a);
  58.             Console.WriteLine(++a);
  59.             Console.WriteLine(a % b);
  60.             Console.WriteLine(--a);
  61.             Console.WriteLine(a--);
  62.  
  63.             Console.WriteLine(a > b);
  64.             Console.WriteLine(a < b);
  65.             Console.WriteLine(a >= b);
  66.             Console.WriteLine(a <= b);
  67.             Console.WriteLine(a == b);
  68.             Console.WriteLine(a != b);
  69.  
  70.             bool x = true;
  71.             bool y = false;
  72.  
  73.             Console.WriteLine(x && y);
  74.             Console.WriteLine(x || y);
  75.             Console.WriteLine(x ^ y);
  76.             Console.WriteLine(!x);
  77.  
  78.             a += 3; // a = a + 3;
  79.  
  80.             Console.WriteLine(1 << 1);
  81.             Console.WriteLine(2 >> 1);
  82.             Console.WriteLine(1 | 2);
  83.             Console.WriteLine(1 & 2);
  84.             Console.WriteLine(1 ^ 3);// 2
  85.  
  86.             string name = "Stoyan";
  87.             string familyName = "Cheresharov";
  88.  
  89.  
  90.             Console.WriteLine(name + " " + familyName + a);
  91.  
  92.             int test1 = 11;
  93.             int test2 = 2;
  94.             Console.WriteLine(test1 / (float)test2);
  95.  
  96.         }
  97.     }
  98. }
  99.  
  100. /*
  101. class HelloKrisitna
  102. {
  103.     public static void Main()
  104.     {
  105.         System.Console.WriteLine("Hello Kristina!");
  106.     }
  107. }
  108. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement