Home
Tool
Json Beautify
Find Web URL
Inventory Management System
Test Mantra RD Service
Calculate your EMI
Project
Inventory Management System
Task Management
Project Management
Mobile Store Management
Money Transfer Tool
Store Management
About Us
Contact
Login
Registration
Search
C-Sharp
Declare function in c#
By
Csharp Code
May 01 2020
1102 View's
0 Comment's
Like (
0
)
Dislike (
0
)
You can declare a function to work separate task and you can use in the main function.
This is none return type function
public
void
DoStuff()
{
Console.WriteLine(
"I'm doing something..."
);
}
This is return type function
public
int
AddNumbers(
int
number1,
int
number2)
{
int
result = number1 + number2;
if
(result > 10)
{
return
result;
}
}
Add in void main
int
result = AddNumbers(12, 3);
Console.WriteLine(result);
0 Comment's
Comment Form
Required
Submit Comment
Csharp Code
If opportunity doesn’t knock, build a door.⛩
Popular Post
WPF
How to Use Logger in WPF Application
By
Csharp Code
Jun 07 2022
C-Sharp
Update Specific Users Out of Oce Settings C# with Example
By
Csharp Code
Jun 06 2022
C-Sharp
Retrieve Specified User''s Out of O ce Settings C# with Example
By
Csharp Code
Jun 06 2022
C-Sharp
Large Object Heap compaction C# with Example
By
Csharp Code
Jun 06 2022
C-Sharp
Weak References C# with Example
By
Csharp Code
Jun 06 2022
C-Sharp
Source code in the view C# with Example
By
Csharp Code
Jun 06 2022
Notifications