search
Login

Categories


C Books Guide and List
C++ Books Guide and List
Best Java Books

3.8k questions

4k answers

117 comments

10.7k users

1 vote
105 views
asked anonymous
edited by

1 Answer

0 votes
A function is a block of code that has a name and it has a property that it is reusable i.e. it can be executed from as many different points in a C Program as required.

int sum(int x, int y)
{
    int ans = 0;     //holds the answer that will be returned
    ans = x + y;    //calculate the sum
    return ans        //return the answer
}
answered Advisor 5.6k points 1 7 14

Related questions

1 vote
1 answer 2.4K views
1 vote
2 answers 606 views
0 votes
1 answer 439 views
439 views
which loop is better in C and C++, for loop or while loop or do while?
asked anonymous
0 votes
1 answer 1K views
1K views
What is the return value from printf() function?
asked carlton Sr Member 4k points 5 11 21
1 vote
2 answers 4.3K views
...