Skip to content

Instantly share code, notes, and snippets.

@MP-C
Last active April 5, 2022 08:41
Show Gist options
  • Save MP-C/c7d887c9c5dea04a6f9bc7d44c7814bd to your computer and use it in GitHub Desktop.
Save MP-C/c7d887c9c5dea04a6f9bc7d44c7814bd to your computer and use it in GitHub Desktop.
1. Les nombres entiers
using System;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
short MaxValue = 0;
Console.WriteLine("maxValue " + MaxValue);
int x = 50;
Console.WriteLine("The new INT X: " + x);
x = (short)MaxValue;
Console.WriteLine("x = (short)MaxValue : " + x +'\n');
long Y = 1234567891234567891;
Console.WriteLine("The new LONG Y: " + Y);
MaxValue = (short)Y;
Console.WriteLine("MaxValue = (short)Y " + MaxValue + '\n');
short Z = 7789;
Console.WriteLine("The new short Z: " + Z);
Z = (short)MaxValue;
Console.WriteLine("new Z : " + Z);
ulong ResultSum = (ulong)x + (ulong)Y + (ulong)Z;
Console.WriteLine("ulong ResultSum = (ulong)x + (ulong)Y + (ulong)Z : " + ResultSum);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment