










































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!











































Data Types and Variables
Table of Contents
How Computing Works?
Variables
A data type has: Name (C# keyword or .NET type) Size (how much memory is used) Default value Example: Integer numbers in C# Name: int Size: 32 bits (4 bytes) Default value: 0 Data Type Characteristics
Naming Variables
Variable Span
Keep Variable Span Short
Type Default Value Min Value Max Value Size sbyte 0 - 128 (- 2 7 ) 127 ( 2 7
**- 1 ) 8 bit byte 0 0 255 ( 2 8
Centuries – Example
E.g. 0xFE, 0xA8F1, 0xFFFFFFFF
E.g. 12345678U, 0U
E.g. 9876543L, 0L Integer Literals
Problem: Integer Operations 10 20 3 3 30 20 30 2 3 75 15 14 2 3 42
What are Floating-Point Types?