DEV Community

Sunnat Qayumov
Sunnat Qayumov

Posted on

2 3 3 3 4

C# - Data types.

                         Data typelarning xotiradagi joyi:
Enter fullscreen mode Exit fullscreen mode

byte byte: Bu 1 baytli butun son bo'lib qiymatlari 0 dan 255 gacha.
sbyte sbyte: Bu 1 baytli butun son bo'lib, qiymati -128 dan 127 gacha.
short short: Bu 2 baytli butun son bo'lib qiymati -32,768 dan 32,767 gacha.
ushort ushort: Bu 2 baytli butun son bo'lib, qiymati 0 dan 65,535 gacha.
int int: ** Bu 4 baytli bo'lib, qiymati **-2,147,483,648 dan 2,147,483,647 gacha.
uint uint: Bu 4 baytli bo'lib, qiymati 0 dan 4.294,967,265 gacha bo'lishi mumkin.
long long: u 8 baytli bo'lib, qiymati -9,223,372,036,854,775,808 dan 9,223,372,036,854,775,807 gacha.

                            using System;

class Program
{
static void Main()
{
    // byte: 8-bit unsigned integer (0 to 255)
    byte myByte = 255;
    Console.WriteLine("byte: " + myByte);

    // sbyte: 8-bit signed integer (-128 to 127)
    sbyte mySByte = -128;
    Console.WriteLine("sbyte: " + mySByte);

    // short: 16-bit signed integer (-32,768 to 32,767)
    short myShort = -32768;
    Console.WriteLine("short: " + myShort);

    // ushort: 16-bit unsigned integer (0 to 65,535)
    ushort myUShort = 65535;
    Console.WriteLine("ushort: " + myUShort);

    // int: 32-bit signed integer (-2,147,483,648 to 2,147,483,647)
    int myInt = -2147483648;
    Console.WriteLine("int: " + myInt);

    // uint: 32-bit unsigned integer (0 to 4,294,967,295)
    uint myUInt = 4294967295;
    Console.WriteLine("uint: " + myUInt);

    // long: 64-bit signed integer (-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807)
    long myLong = -9223372036854775808;
    Console.WriteLine("long: " + myLong);

    // ulong: 64-bit unsigned integer (0 to 18,446,744,073,709,551,615)
    ulong myULong = 18446744073709551615;
    Console.WriteLine("ulong: " + myULong);
}
Enter fullscreen mode Exit fullscreen mode

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (2)

Collapse
 
mushtariy profile image
Mushtariy

zo'r

Collapse
 
sunnat_qayumov profile image
Sunnat Qayumov

raxmat raxmat

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay