We use Visual Studio to create and run programs in C# Language. Open Visual Studio and Create new Console Application in C #. Console Applications Interface has “Only Texts” Your First Program will look like this using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Escalera { class Program { static void Main(string[] args) { // “we will code here” } } } All C# console application should have a method (which is a function) named Main. Program Execution Starts from Here . Lets Print the sentence in our console application static void Main(string[] args) {        Console.Writeline(“I am Learning C# From EscaleraRead More →

We can use this code to Calculate Sum of All Elements in array We can use FOREACH Loop for this task. int[ ] arr = {13, 36, 63, 556, 990}; int sum = 0; foreach (int a in arr) { sum += a; } Console.WriteLine(sum); //This Code Outputs :  “1658” Because 13 + 36 + 63 + 556 + 990 = 1658. // Our Array ‘arr’ has 5 elements. Sum is initialized with value ‘0’. // We are adding values of integer ‘a’ from the array to the variable sum for all values of ‘a’Read More →

Variables c sharp

Variables c sharp A “variable” is created in C # programming to reserve a location in memory space to store values. Variable as the name suggests has dynamic values. A variable has a Name and a Data Type. Data Type can be string, integer, double, float etc. A Variable must be declared with its data type and then can be used in the program. Variable are used to perform logical operations. An Example of Variable Name is yourName , yourAge These are examples of Good Descriptive Variable Names. If we simply write mno OR pqr , variable will be declared but this is not aRead More →