166k views
3 votes
Which line in the following program contains the header for the showDub function? 1 #include 2 using namespace std; 3 4 void showDub(int); 5 6 int main() 7 { 8 int x = 2; 9 10 showDub(x); 11 cout << x << endl; 12 return 0; 13 } 14 15 void showDub(int num) 16 { 17 cout << (num * 2) << endl; 18 } 1. 4 2. 6 3. 10 4. 1

User SvenL
by
5.1k points

1 Answer

4 votes

Answer:

The answer to this question is "15 line".

Explanation:

A function is a block of ordered, portable code used to perform a single, connected operation. The syntax of function declaration can be given as:

Syntax :

returntype functionName(parameter1, parameter2); //function prototype

or declaration

returntype functionName(parameter1, parameter2) //function definition or header of the function

{

//function body.

//function implementation

//return value;

}

In the given question the header of the showDub function is on line 15.

That's why the answer to this question is "15 line".

User Northener
by
5.5k points