Function Declarations

1

How many minimum number of functions are need to be presented in c++?

A. 0
B. 1
C. 2
D. 3

2

What is the scope of the variable declared in the user definied function?

A. whole program
B. only inside the {} block
C. both a and b
D. none of the mentioned

3

What is the output of this program?

1.
    #include 
2.    
    using namespace std;
3.    
    void fun(int x, int y)
4.    
    {
5.    
        x = 20;
6.        
        y = 10;
7.        
    }
8.    
    int main()
9.    
    {
10.    
        int x = 10;
11.        
        fun(x, x);
12.        
        cout << x;
13.        
        return 0;
14.        
    }
A. 10
B. 20
C. compile time error
D. none of the mentioned

4

What is the output of this program?

1.
    #include 
2.    
    using namespace std;
3.    
    void mani()
4.    
    void mani()
5.    
    {
6.    
        cout<<"hai";
7.        
    }
8.    
    int main()
9.    
    {
10.    
        mani();
11.        
        return 0;
12.        
    }
A. hai
B. haihai
C. compile time error
D. none of the mentioned

5

Which is more effective while calling the functions?

A. call by value
B. call by reference
C. call by pointer
D. none of the mentioned