Sail E0 Webinar

MCQs

Total Questions : 40 | Page 2 of 4 pages
Question 11.


What will be the output of the following program?


#include
int main()
{
float Amount;
float Calculate(float P = 5.0, int N = 2, float R = 2.0);
Amount = Calculate();
cout
  1.    21
  2.    22
  3.    31
  4.    32
  5.    None of these
 Discuss Question
Answer: Option D. -> 32


Question 12.


What will be the output of the following program?


#include
double BixFunction(double, double, double = 0, double = 0, double = 0);
int main()
{
double d = 2.3;
cout
  1.    7 20
  2.    7 19.8
  3.    7 Garbage
  4.    7 20.8
 Discuss Question
Answer: Option D. -> 7 20.8


Question 13.


What will be the output of the following program?


#include
class IndiabixSample
{
public:
int a;
float b;
void BixFunction(int a, float b, float c = 100.0f)
{
cout
  1.    0
  2.    5
  3.    100
  4.    -5
  5.    None of these
 Discuss Question
Answer: Option B. -> 5


Question 14.


Which of the following statement is correct about the program given below?


#include
class PowerFinder
{
public:
void Power(int x = 1, int y = 1)
{
int P = 1, i = 1;
while(++i
  1.    The program will print the output 12.
  2.    The program will print the output 16.
  3.    The program will print the output 32.
  4.    The program will print the output 36.
  5.    The program will execute infinite time.
 Discuss Question
Answer: Option C. -> The program will print the output 32.


Question 15.


Which of the following statement is correct about the program given below?


#include
long FactFinder(long = 5);
int main()
{
for(int i = 0; i
  1.    The program will print the output 1.
  2.    The program will print the output 24.
  3.    The program will print the output 120.
  4.    The program will print the output garbage value.
  5.    The program will report compile time error.
 Discuss Question
Answer: Option B. -> The program will print the output 24.


Question 16.


Which of the following statement is correct about the program given below?


#include
struct MyStructure
{
class MyClass
{
public:
void Display(int x, float y = 97.50, char ch = 'a')
{
cout
  1.    The program will print the output 12 97.50 b.
  2.    The program will print the output 12 97.50 a.
  3.    The program will print the output 12 98 a.
  4.    The program will print the output 12 Garbage b..
  5.    The program will print the output 12 Garbage a.
 Discuss Question
Answer: Option C. -> The program will print the output 12 98 a.


Question 17.


What will be the output of the following program?


#include
struct MyData
{
public:
int Addition(int a, int b = 10)
{
return (a *= b + 2);
}
float Addition(int a, float b);
};
int main()
{
MyData data;
cout
  1.    12 12
  2.    12 18
  3.    3 14
  4.    18 12
  5.    Compilation fails.
 Discuss Question
Answer: Option B. -> 12 18


Question 18.


What will be the output of the following program?


#include
typedef void(*FunPtr)(int);
int Look(int = 10, int = 20);
void Note(int);
int main()
{
FunPtr ptr = Note;
(*ptr)(30);
return 0;
}
int Look(int x, int y)
{
return(x + y % 20);
}
void Note(int x)
{
cout
  1.    10
  2.    20
  3.    30
  4.    40
  5.    Compilation fails.
 Discuss Question
Answer: Option C. -> 30


Question 19.


Which of the following statement is correct about the program given below?


#include
long GetNumber(long int Number)
{
return --Number;
}
float GetNumber(int Number)
{
return ++Number;
}
int main()
{
int x = 20;
int y = 30;
cout
  1.    The program will print the output 19 31.
  2.    The program will print the output 20 30.
  3.    The program will print the output 21 31.
  4.    The program will print the output 21 29.
  5.    Program will report compile time error.
 Discuss Question
Answer: Option C. -> The program will print the output 21 31.


Question 20.


Which of the following statement is correct about the program given below?


#include
static int b = 0;
void DisplayData(int *x, int *y = &b)
{
cout
  1.    The program will print the output 10 20.
  2.    The program will print the output 10 0.
  3.    The program will print the output 10 garbage.
  4.    The program will report compile time error.
 Discuss Question
Answer: Option A. -> The program will print the output 10 20.


Latest Videos

Latest Test Papers