C# Basics

C# .Net – Variables

Variable: Definition1: Variable is an identity given to memory location. Definition2: Variable is a named memory location Declaration, Assignment, Update and Initialization of Variable: Identifier rules: Rules to create identifier:

C# .Net – Data types

Data type: Syntax:  Example: Data types classified into Primitive and Non-Primitive types. Data Types Memory Size Range char 1 byte -128 to 127 short 2 byte -32,768 to 32,767 int 4 byte -2,147,483,648 to -2,147,483,647 long 8 byte ?9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 float 4 byte 1.5 * 10-45 – 3.4 * 1038, 7-digit precision double 8 byte …

C# .Net – Data types Read More »

C# .Net – Type Casting

Type casting: Convert Character to Integer: this conversion happens implicitly when we assign character to integer type. Convert Integer to Character: this conversion must be done manually Convert Upper case to Lower case Character: Lower Case to Upper Case Upper Case to Lower Case A(65) + 32 -> a(97)B(66) + 32 -> b(98)……Z(90) + 32 …

C# .Net – Type Casting Read More »

C# .Net – Formatting Output

Formatting: It is important to format the output before display the results to end user. Proper formatting makes the user more understandable about program results. We always display results in String format. To format the output, we concatenate the values such as int, char, double, boolean with messages (string type) as follows: Syntax Example int …

C# .Net – Formatting Output Read More »

Scroll to Top