Exercise: Python

Questions for: Functions

Which of the following statement is correct about the program given below?
#include<iostream.h>
void Tester(float xx, float yy = 5.0);
class ExamAdept
{
    float x; 
    float y; 
    public:
    void Tester(float xx, float yy = 5.0)
    {
        x = xx;
        y = yy;
        cout<< ++x % --y; 
    }
};
int main()
{
    ExamAdept objBix;
    objBix.Tester(5.0, 5.0);
    return 0; 
}
A:
The program will print the output 0.
B:
The program will print the output 1.
C:
The program will print the output 2.
D:
The program will print the output garbage value.
Answer: E
No answer description is available. Let's discuss.
Which of the following statement is correct about the program given below?
#include<iostream.h> 
class PowerFinder
{
    public:
    void Power(int x = 1, int y = 1)
    {
        int P = 1, i = 1;
        while(++i <= y)
        {
            P *= x;
        }
        cout<< P << endl; 
    } 
};
int main()
{
    PowerFinder FP; 
    FP.Power(2, 6); 
    return 0;
}
A:
The program will print the output 12.
B:
The program will print the output 16.
C:
The program will print the output 32.
D:
The program will print the output 36.
Answer: C
No answer description is available. Let's discuss.
Which of the following statement is correct about the program given below?
#include<iostream.h>
void Tester(int xx, int yy = 5);
class ExamAdept
{
    int x; 
    int y; 
    public:
    void Tester(int xx, int yy = 5)
    {
        x = xx;
        y = yy;
        cout<< ++x % --y; 
    }
};
int main()
{
    ExamAdept objBix;
    objBix.Tester(5, 5);
    return 0; 
}
A:
The program will print the output 0.
B:
The program will print the output 1.
C:
The program will print the output 2.
D:
The program will print the output garbage value.
Answer: C
No answer description is available. Let's discuss.
What will be the output of the following program?
#include<iostream.h> 
class ExamAdept
{
    public:
        int   a; 
        float b;
        void BixFunction(int a, float b, float c = 100.0f)
        {
            cout<< a % 20 + c * --b;
        } 
}; 
int main()
{   ExamAdept objBix;
    objBix.BixFunction(20, 2.000000f, 5.0f);
    return 0; 
}
A:
0
B:
5
C:
100
D:
-5
Answer: B
No answer description is available. Let's discuss.
Which of the following statement is correct about the program given below?
#include<iostream.h>
int BixTest(int x, int y);
int BixTest(int x, int y, int z = 5);
int main()
{
    cout<< BixTest(2, 4) << endl; 
    return 0;
}
int BixTest(int x, int y)
{
    return x * y;
}
int BixTest(int x, int y, int z = 5)
{
    return x * y * z; 
}
A:
The program will print the output 5.
B:
The program will print the output 8.
C:
The program will print the output 40.
D:
The program will report compile time error.
Answer: D
No answer description is available. Let's discuss.
Ad Slot (Above Pagination)
Quiz