The foreach is used to loop through arrays or collection like lists in C#. The foreach loop is used with the in statement. This makes the process of looping through the array or collection elements simpler.
The C# while loop is one of the available loops in the C Sharp like in other programming languages. The while loop executes the given statement or block of code repeatedly until the given condition is true.
The switch statement is a decision-making statement which is used to execute a block of code when you have various blocks in C# program. The C# switch is useful when you have long blocks of if, if..else statement
A string is a type of variable in C# programming. Each character in the string is a Unicode character. C sharp Strings are objects.
The if is a decision-making statement in C# programming which is used to execute a block of code if a given condition evaluates as true.
In a for loop, you have to set the counter that will be checked in each iteration against a given condition, followed by the increment or decrement operator (counter update).
The ArrayList is a class of System.Collection namespace in C# which is just like the arrays. However, unlike simple arrays, the ArrayList in C# is dynamic.
An array is a collection of similar type variables. The base class of the array in C# is Array which is defined in the System namespace. The elements of an array can be accessed by using the index number.
The list is a collection of elements or variables in a specified order. The difference between array and list is that the list is dynamically sized whereas arrays are fixed.