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 return type in C#
C# Online Editor
Execute Code
More C# Sample Code
using System; namespace ExampleApp { class Program { static void Main(string[] args) { //return string data string returnStringValue = MethodReturnString(); // Calling the method. Console.WriteLine(returnStringValue); // writing return value //return integer data int returnIntegerValue = MethodReturnInteger(); // Calling the method. Console.WriteLine("This method returns integer: " + returnIntegerValue); // writing return value } static string MethodReturnString() // method returns string type { return "This method returns string data."; //return string } static int MethodReturnInteger() // method returns integer type { return 10 + 11; //return integer } } }