xFactorSchool.com(Beta)
How to Do Examples
Python Examples
HTML Examples
Code Examples
C Code Examples
C++ Code Examples
C# Code Examples
Java Code Examples
Python Code Examples
HTML Code Examples
CSS Code Examples
JavaScript Code Examples
Online Editor
C Code Editor
C++ Code Editor
C# Code Editor
Java Code Editor
Python Code Editor
HTML Code Editor
CSS Code Editor
JavaScript Code Editor
Practice how to create and call a method with parameter in C#
C# Online Editor
Execute Code
More C# Sample Code
using System; namespace ExampleApp { class Program { static void Main(string[] args) { //Example 1 method called string returnStringValue = MethodReturnString("Hello from parameter"); // "Hello from parameter" is passed to the method as parameter value. Console.WriteLine(returnStringValue); // writing return value //Example 2 method called int returnIntegerValue = MethodReturnInteger(10, 20); // 10 and 20 are passed as parameter values of x and y. Console.WriteLine("This method returns the sum of parameter values: " + returnIntegerValue); // writing return value } //Example 1: static string MethodReturnString(string message) // message is a string type parameter { return message; //message parameter value will be returned } //Example 2: static int MethodReturnInteger(int x, int y) // x and y are integer type parameters { return x + y; //return value of parameters } } }