What is the main difference between sub-procedure and function?

The sub-procedure is a block of multiple visual basic statements within Sub and End Sub statements. It is used to perform certain tasks, such as changing properties of objects, receiving or processing data, and displaying an output. You can define a sub-procedure anywhere in a program, such as in modules,… Continue reading

Briefly explain the characteristics of reference-type variables that are supported in the C# programming language.

The variables that are based on reference types store references to the actual data. The keywords that are used to declare reference types are: Class – Refers to the primary building block for the programs, which is used to encapsulate variables and methods into a single unit. Interface – Contains… Continue reading

Briefly explain the characteristics of value-type variables that are supported in the C# programming language.

The variables that are based on value types directly contain values. The characteristics of value-type variables that are supported in C# programming language are as follows: All value-type variables derive implicitly from the System.ValueType class You cannot derive any new type from a value type Value types have an implicit… Continue reading

What does a break statement do in the switch statement?

The switch statement is a selection control statement that is used to handle multiple choices and transfer control to the case statements within its body. The following code snippet shows an example of the use of the switch statement in C#: switch(choice) { case 1: console.WriteLine(“First”); break; case 2: console.WriteLine(“Second”);… Continue reading