Objects and Classes

Q1:
What will be the output of the following program?
#include<iostream.h> 
class AptitudeCrack
{
    static int count; 
    public:
    static void First(void)
    {
        count = 10;
    }
    static void Second(int x)
    {
        count = count + x; 
    }
    static void Display(void)
    {
        cout<< count << endl;
    } 
};
int AptitudeCrack::count = 0; 
int main()
{
    AptitudeCrack :: First();
    AptitudeCrack :: Second(5);
    AptitudeCrack :: Display();
    return 0; 
}

A 0

B 5

C 10

D 15

E The program will report compile time error.


img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.