Here is the listing of C# programming examples on Functions.
1. C# Examples on Predefined Functions
A group of statements which is used to perform a specific task is called a function. The built-in functions which perform standard operations are called pre-defined functions. The following C# Programs reverses and sorts a string using various predefined functions and the other programs use the concept of recursion to display the binary form of an integer and for calculating the sum of all the digits in a number.
2. C# Examples on Classes and their Abstract Properties
A class is a blueprint from which individual objects are extracted. Abstract property does not contain any implementation of property accessors, it only includes the declaration that the class supports properties. iCollection count returns the number of elements in the collection. The following C# Programs demonstrates the properties of normal class and abstract classes, iCollection property and multiplication of numbers using recursion.
3. C# Examples on Method Types and Method Hiding
Method hiding is a phenomenon in which a subclass has defined a class method with the same signature as a class method in the superclass. In that case the superclass method is hidden by the subclass. Goto statement is used for modifying the normal sequence of program execution by transferring control to some other part of the program. Static method can be invoked without creating an instance of a class. The method without any name is called anonymous method. The Obsolete attribute marks a program entity as one that is no longer recommended for use. The CultureInfo class contains culture-specific information, such as the associated language, sub-language, country/region, calendar, and cultural conventions. The following C# programs demonstrate the various properties mentioned above.
4. C# Examples on Namespaces and Preprocessor Attributes
Nullable data type assigns null values to data types. #define preprocessor substitutes a preprocessor macro. A namespace is a collection of pages which have content with a similar purpose. The following C# Programs demonstrate pass by value, pass by reference, namespaces, preprocessors new modifier and various nullable data types.