Sobes.tech
Intern — Junior

Can you explain what is meant by the term 'function' in programming?

sobes.tech AI

Answer from AI

In programming, a function is a named block of code that performs a specific task and can accept input data (parameters), as well as return a result.

Functions help structure the program, reuse code, and make it more readable.

Example of a function in C#:

int Sum(int a, int b) {
    return a + b;
}

// Using the function
int result = Sum(3, 5); // result will be 8