Practice mode C#

How many bytes does a value of the C# type long occupy?

Correct answer A. 8

Explanation

long is an alias for System.Int64, a signed 64-bit integer, so it takes 8 bytes and ranges from about -9.2 quintillion to 9.2 quintillion. int is 32-bit (4 bytes), short is 16-bit (2 bytes) and decimal is 128-bit (16 bytes). Unlike C and C++, C# fixes these sizes in the language, so they do not vary between platforms.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.