Online Test

:

 

What do we need to do to pointer for overloading the subscript operator?


Which operators are part of RTTI?


What is the output of this program?

     #include <iostream.h>
    using namespace std;
    #define MIN(a,b) (((a)<(b)) ? a : b)
    int main ()
    {
        float i, j;
        i = 100.1;
        j = 100.01;
        cout <<"The minimum is " << MIN(i, j) << endl;
        return 0;
    }

What are mandatory parts in function declaration?


Which of the following is false?


 What is the output of this program?

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

How many parameters are required for sort_heap function?


What will be the output of the following program?

#include<iostream.h> 
void MyFunction(int a, int b = 40)
{
    cout<< " a = "<< a << " b = " << b << endl;
}
int main()
{
    MyFunction(20, 30);
    return 0; 
}

What is the output of this program?

    #include <iostream>
    using namespace std;
    int main()
    {
        double a = 21.09399;
        float b = 10.20;
        int c ;
        c = (int) a;
        cout << c ;
        c = (int) b;
        cout << c ;
        return 0;
    }

What are the advantages of passing arguments by reference?


What is the output of this program?

    #include <iostream.h>
    using namespace std;
    void Sum(int a, int b, int & c)
    {
        a = b + c;
        b = a + c;
        c = a + b;
    }
    int main()
    {
        int x = 2, y =3;
        Sum(x, y, y);
        cout << x << " " << y;
        return 0;
    }

 What is the output of this program?

   #include <iostream.h>
    using namespace std;
    #define MAX 10
    int main()
    {
        int num;
        num = ++MAX;
        cout << num;
        return 0;
    }

What is the output of this program?

#include <iostream.h>
    using namespace std;
    #define PI 3.14159
    int main ()
    {
        float r = 2;
        float circle;
        circle = 2 * PI * r;
        cout << circle;
        return 0;
    }

In C++, dynamic memory allocation is accomplished with the operator ____ 


What is the output of this program?

    #include <iostream>
    using namespace std;
    long factorial (long a)
    {
        if (a > 1)
            return (a * factorial (a + 1));
        else
            return (1);
    }
    int main ()
    {
        long num = 3;
        cout << num << "! = " << factorial ( num );
        return 0;
    }
 

About Us

TechEpi.com is an online learning website.We cover the latest tech news,online tutorials,blog,online test for Aptitude,C,Java,PHP to improve your knowledge.

Newsletter


Follow TechEpi on