Cpp Programming Quiz 174 – Which of the following function / types of function cannot have default parameters?
[B].main()[C].Member function of structure
[D].Both B and C
Answer: Option B
Answer: Option B
Answer: Option B
Answer: Option C
#include
class BixArray
{
    int array[3][3];
    public:
    BixArray(int arr[3][3] = NULL)
    {
        if(arr != NULL)
        for(int i = 0; i < 3; i++) 
            for(int j = 0; j < 3; j++) 
                array[i][j] = i+j; 
    } 
    void Display(void)
    {
        for(int i = 0; i < 3; i++) 
            for(int j = 0; j < 3; j++)
                cout<< array[i][j] << " "; 
    }
};
int main()
{
    BixArray objBA;
    objBA.Display();
    return 0; 
}
[A].The program will report error on compilation.
[B].The program will display 9 garbage values.
[C].The program will display NULL 9 times.
[D].The program will display 0 1 2 1 2 3 2 3 4.
Answer: Option B
Answer: Option D
#include
#include
class IndiaBix
{
    char txtMsg[50];
    public:
    IndiaBix(char *str = NULL)
    {
    if(str != NULL)
       strcpy(txtMsg, str);
    }
    int BixFunction(char ch);
};
int IndiaBix::BixFunction(char ch)
{
    static int i = 0;
    if(txtMsg[i++] == ch)
        return strlen((txtMsg + i)) - i;
    else
        return BixFunction(ch);
}
int main()
{
    IndiaBix objBix("Welcome to IndiaBix.com!");
    cout<< objBix.BixFunction('t');
    return 0;
}
[A].6
[B].8
[C].9
[D].15 
Answer: Option A
Answer: Option C