Skip to content

Basic types print

CodingUnit edited this page Dec 1, 2011 · 7 revisions

Basic types print

  • Category: Arithmetic

  • Description: Basic types print

  • Code:

using System.Console;

def _int = 53;
def _string = "This is a string";
def _char = 'e';
def _bool = true;
def hexint = 0x63;
def octalint = 0o12;
def binaryinteger = 0b110110;
def signedbyte = 81 : sbyte;
def unsignedbyte = 122 : byte;
def smallint = 63 : short;
def smalluint = 61 : ushort;
def integer = 353l;
def usignedint = 351ul;
def nativeint = 7511 : int;
def unsignednativeint = 7653 : uint;
def _long = 12345678912345789L;
def unsignedlong = 12345678912345UL;
def float32 = 12.8F;
def _float = 552.8;
def lst = [1, 2, 3];
           
WriteLine($"int = $_int");
WriteLine($"string = $_string");
WriteLine($"char = $_char");
WriteLine($"bool = $_bool");
WriteLine($"hex int = $hexint");
WriteLine($"HEX INT = $hexint");
WriteLine($"oct int = $octalint");
WriteLine($"bin int = $binaryinteger");
WriteLine($"signed byte = $signedbyte");
WriteLine($"unsigned byte = $unsignedbyte");
WriteLine($"small int = $smallint");
WriteLine($"small uint = $smalluint");
WriteLine($"int = $integer");
WriteLine($"uint = $usignedint");
WriteLine($"native int = $nativeint"); 
WriteLine($"unsigned native int = $unsignednativeint");
WriteLine($"long = $_long");
WriteLine($"unsigned long = $unsignedlong");
WriteLine($"float = $float32");
WriteLine($"double = $_float");

WriteLine($"splice integer operations = $(integer * 210 + 1)");
WriteLine($"list = ..$lst");
WriteLine($<#list with delimiter = ..$(lst; ";")#>);
WriteLine($<#list with operations = ..$(lst; "; "; x => $"x * 2 = $(x * 2)")#>);
  • Execution Result:
 
  int = 53
  string = This is a string 
  char = e 
  bool = True
  hex int = 99 
  HEX INT = 99 
  oct int = 10 
  bin int = 54 
  signed byte = 81
  unsigned byte = 122 
  small int = 63 
  small uint = 61 
  int = 353 
  uint = 351
  native int = 7511 
  unsigned native int = 7653 
  long = 12345678912345789
  unsigned long = 12345678912345 
  float = 12,8 
  double = 552,8 
  splice integer operations = 74131 
  list = 1, 2, 3 
  list with delimiter = 1;2;3
  list with operations = x \* 2 = 2; x \* 2 = 4; x \* 2 = 6 

[Copyright ©](Terms of use, legal notice)

Clone this wiki locally