w3resource
C# Sharp Programming Exercises

C# Sharp Exercises: Function: Learn, how to create a user define function

C# Sharp Function: Exercise-1 with Solution

Write a program in C# Sharp to create a user define function.

Pictorial Presentation:

C# Sharp Exercises: Function: Learn, how to create a user define function

Sample Solution:

C# Sharp Code:

using System;
class funcexer1
{
    public static void welcome() 
    {
        Console.WriteLine("Welcome Friends!");
    }
 
    public static void HaveAnice()
    {
        Console.WriteLine("Have a nice day!");
    }
 
    public static void Main()
    {
    Console.Write("\n\nSee, how to create an user define function :\n");
    Console.Write("------------------------------------------------\n"); 	
        welcome();
        HaveAnice();
		Console.Write("\n");
    }
}

Sample Output:

See, how to create an user define function :                                                                  
------------------------------------------------                                                              
Welcome Friends!                                                                                              
Have a nice day!

Flowchart :

Flowchart: C# Sharp Exercises - Learn, how to create a user define function

C# Sharp Code Editor:

Improve this sample solution and post your code through Disqus

Previous: C# Sharp programming exercises Function with Solution.
Next: Write a program in C# Sharp to create a user define function with parameters.

What is the difficulty level of this exercise?



New Content: Composer: Dependency manager for PHP, R Programming