Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace MyNamespace
- {
- class Program
- {
- // Function has 3 parts.
- // 1. Type
- // 2. Name
- // 3. Parameter List
- // Functions must be declared only in class or struct.
- // [type] [name] [parameter list]
- string sayHello(string name, string surname)
- {
- string text = "Hello, " + name;
- return text;
- }
- static void Main()
- {
- Program p = new Program();
- string result = p.sayHello(surname: "Alizada", name: "Vagif");
- System.Console.WriteLine(result);
- // System.Console.WriteLine("Hello, Vagif");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement