My Report

C++ Function Test – 1


Correct Answer: 2 points | Wrong: -1 point
Grades: A* (100% score) | A (80%-99%) | B (60%-80%) | C (40%-60%) | D (0%-40%)
advertisement

1. What is the scope of the variable declared in the user defined function?

2. What will be the output of the following C++ code?

    #include <iostream>
    using namespace std;
    void mani()
    void mani()
    {
        cout<<"hai";
    }
    int main()
    {
        mani();
        return 0;
    } 

3. What are mandatory parts in the function declaration?

4. What will be the output of the following C++ code?

    #include <iostream>
    using namespace std;
    void fun(int x, int y)
    {
        x = 20;
        y = 10;
    }
    int main()
    {
        int x = 10;
        fun(x, x);
        cout << x;
        return 0;
    } 

5. How many minimum number of functions should be present in a C++ program for its execution?

6. Where does the execution of the program starts?

7. which of the following is used to terminate the function declaration?

8. How many can max number of arguments present in function in the c99 compiler?

9. Which is more effective while calling the functions?


 

Start practicing “1000 MCQs on C++”, and once you are ready, you can take tests on all topics by attempting our “C++ Test Series”.

Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.