Declare Multiple Variables in C# . In this program we can print the declare the many variable and print the output. Program in C# for declaring a large number of variables Using this program, we can print out the declarations of the many variables, as well as the results. Use a comma-separated list to declare more than one variable of the same type.
static void Main(string args)
int x = 10, y =10, z = 10;
Console.WriteLine(x + y + z);
Static void main(string args)
Using static without creating an object allows you to use variables from a method. The return type is void, which stands for “empty”. there is no value returned by the function. the main method is the main method. This predefined class is String. Args is a string class variable. Objects and variables are created in the Main method. When the C# program is started, the main method is available to run. There are no instances of the class created because it’s the program’s main entry point.
Main Advantages of C#
As opposed to C#, which is a pure object-oriented programming language, C++ is a hybrid of both object-oriented and procedure-oriented. It’s safe to use C # because it’s a type safe language. Memory loss, which is a concern for C++ programmers, does not require much attention from a programmer.