InterviewSolution
Saved Bookmarks
| 1. |
Functions |
|
Answer» int sum (int a, int b){ // Declaration return a+b; } int main(){ int first_number= 10; int second_number = 20; cout<< sum(first_number, second_number); // Calling a function } When a function is called, it is a collection of statements that are all executed at the same time. Every function has a name that is used to refer to it when it is called. A function typically contains the following parts:
|
|