void Keyword in C# Last Updated : 22 Jun, 2020 Comments Improve Suggest changes Like Article Like Report Keywords are the words in a language that are used for some internal process or represent some predefined actions. void is a keyword, it is a reference type of data type and used to specify the return type of a method in C#. It is an alias of System.Void. Syntax: public void function_name([parameters]) { //body of the function } Note: void cannot be used as a parameter if there is no parameter in a C# method. Example: Input: Geeks multi = 50*20 Output: Geeks multi = 1000 Output: GeeksforGeeks sum = 80+20 sub = 40-10 Output: GeeksforGeeks sum = 100 sub = 30 Example 1: csharp // C# program for void keyword using System; class GFG { public void SimpleText() { Console.WriteLine("Geeks"); } public void sum(int a, int b) { Console.WriteLine("multi = " + (a * b)); } }; class Prog { static void Main(string[] args) { // calling functions GFG ex = new GFG(); ex.SimpleText(); ex.sum(50, 20); } } Output: Geeks multi = 1000 Example 2: csharp // C# program for void keyword using System; using System.Text; namespace Test { class Sample { public void SimpleText() { Console.WriteLine("GeeksforGeeks"); } public void sum(int a, int b) { Console.WriteLine("sum = " + (a + b)); } public void sub(int c, int d) { Console.WriteLine("sub = " + (c - d)); } }; class Prog { static void Main(string[] args) { // calling functions Sample ex = new Sample(); ex.SimpleText(); ex.sum(80, 20); ex.sub(40, 10); // hit ENTER to exit Console.ReadLine(); } } } Output: GeeksforGeeks sum = 100 sub = 30 Comment More infoAdvertise with us Next Article void Keyword in C# S shivanisinghss2110 Follow Improve Article Tags : C# CSharp-keyword Similar Reads var keyword in C# Keywords are the words in a language that are used for some internal process or represent some predefined actions. var is a keyword, it is used to declare an implicit type variable, that specifies the type of a variable based on initial value. Syntax: var variable_name = value; Example: Input: a = 6 2 min read long keyword in C# Keywords are the words in a language that are used for some internal process or represent some predefined actions. long is a keyword that is used to declare a variable which can store a signed integer value from the range of -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807. It is an alias of 2 min read uint keyword in C# Keywords are the words in a language that are used for some internal process or represent some predefined actions. uint is a keyword that is used to declare a variable which can store an integral type of value (unsigned integer) from the range of 0 to 4,294,967,295. It keyword is an alias of System. 2 min read short keyword in C# Keywords are the words in a language that are used for some internal process or represent some predefined actions. short is a keyword that is used to declare a variable which can store a signed integer value from the range -32, 768 to 32, 767. It is an alias of System.Int16. Syntax: short variable_n 2 min read ulong keyword in C# Keywords are the words in a language that are used for some internal process or represent some predefined actions. ulong is a keyword that is used to declare a variable which can store an unsigned integer value from the range 0 to 18,446,744,073,709,551,615. It is an alias of System.UInt64. ulong ke 2 min read Like