C# Online Compiler
Example: C# Hello World Program Using a Separate Function
C
C++
C#
Java
Python
PHP
main.cs
STDIN
Run
// C# HELLO WORLD PROGRAM USING A SEPARATE FUNCTION using System; class W3CW { // This function prints the hello world messages static void PrintMessage() { Console.WriteLine("C# HELLO WORLD PROGRAM"); Console.WriteLine("HELLO, WORLD!"); } static public void Main(string[] args) { // Call the function to print the message PrintMessage(); } }
Output
Clear
ADVERTISEMENTS