-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVariables.cs
39 lines (32 loc) · 1.1 KB
/
Variables.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System;
namespace CSharp.basics;
public static class Variables
{
public static void PrintVariables()
{
// (1) "Integers"
int x = 5;
int y = 10;
int z = 20;
int intNumber = 30;
// (2) "Floatings"
float a = 3.14f;
float b = 7.62f;
float floatNumber = 0.25f;
// (3) "Strings"
string firstName = "Marius";
string lastName = "Chivu";
// (4) "Characters"
char firstLetterOfFirstName = 'M';
char firstLetterOfLastName = 'C';
// (5) "Booleans"
bool open = true;
bool close = false;
// Print values
Console.WriteLine($"Integers: x={x}, y={y}, z={z}, intNumber={intNumber}");
Console.WriteLine($"Floatings: a={a}, b={b}, floatNumber={floatNumber}");
Console.WriteLine($"Strings: firstName={firstName}, lastName={lastName}");
Console.WriteLine($"Characters: firstLetterOfFirstName={firstLetterOfFirstName}, firstLetterOfLastName={firstLetterOfLastName}");
Console.WriteLine($"Booleans: open={open}, close={close}");
}
}