C# Programing Eng. Ahmed ElSangary, MCT [email protected] https://www.linkedin.com/in/ahmedelsangary/
Basics Learn the building blocks of C# such as variables, data types, and operators. Identifiers Variables Data Types Constants and Literals Scope of Variables Params Type Casting Comments Operators 2
Simple C# program to illustrate identifiers using System; class Geeks { // Main Method static public void Main() { // variable int a = 10; int b = 39; int c; // basic operation c = a + b; Console.WriteLine ("The sum of two number is: {0}", c); } } 3
C# Variables 4 Variables Declaration Syntax: type variable_name = value; vs type variable_names ; Characteristics of Variables name : type : value : Rules for Naming Variables E xample: int geeks; float interest; Two Ways for Variable Initialization Compile Time Initialization Run-Time Initialization