pupesko

SoftUni - 3.1 Declare Variables

Oct 26th, 2015
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.73 KB | None | 0 0
  1. //Declare five variables choosing for each of them the most appropriate of the types byte, sbyte, short, ushort, int, uint, long, ulong to represent the following values: 52130, -115, 4825932, 97, -10000. Choose a large enough type for each number to ensure it will fit in it. Try to compile the code.
  2.  
  3. using System;
  4. using System.Runtime.InteropServices;
  5.  
  6. class Program
  7.     {
  8.         static void Main()
  9.         {
  10.             ushort seconds = 52130;
  11.             sbyte moneyAccount = -115;
  12.             int lifeTime = 4825932;
  13.             sbyte myGrandMa = 97;
  14.             short carFilter = -10000;
  15.        
  16.             Console.WriteLine("{0}\n{1}\n{2}\n{3}\n{4}", seconds, moneyAccount, lifeTime, myGrandMa, carFilter);
  17.  
  18.         }
  19.     }
Advertisement
Add Comment
Please, Sign In to add comment