C# - Programming Language
This course covers the basics of programming in C#. Work your way through the videos and we'll teach you everything you need to know to start your programming journey!

Data Types

Lesson 5
Author : Mike Dane
Last Updated : November, 2017


Code

Copystring name = "Mike";    // String's are objects not primitives
char testGrade = 'A';    // single 16-bit Unicode character.

// short, int, long can be pre-pended with 'u' for 'unsigned'
byte age0 = 0;           // 8-bit unsigned integer
short age1 = 10;         // 16-bit signed integer.
int age2 = 20;           // 32-bit signed integer
long age3 = 30L;         // 64-bit signed integer

float gpa0 = 2.5F;       // 32-bit floating point
double gpa1 = 3.5;       // 64-bit double-precision floating point
decimal gpa2 = 4.5M;     // 128-bit precise decimal

bool isTall;             // 1 bit -> true/false
isTall = true;

name = "John";

Console.WriteLine("Your name is " + name);
Console.WriteLine($"Your name is {name}");