C++ Programming - Functions
Exercise : Functions - Programs
- Functions - General Questions
- Functions - Programs
11.
Which of the following statement is correct about the program given below?
#include<iostream.h>
void Tester(int xx, int yy = 5);
class IndiaBix
{
int x;
int y;
public:
void Tester(int xx, int yy = 5)
{
x = xx;
y = yy;
cout<< ++x % --y;
}
};
int main()
{
IndiaBix objBix;
objBix.Tester(5, 5);
return 0;
}
12.
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;
}
13.
Which of the following statement is correct about the program given below?
#include<iostream.h>
void Tester(float xx, float yy = 5.0);
class IndiaBix
{
float x;
float y;
public:
void Tester(float xx, float yy = 5.0)
{
x = xx;
y = yy;
cout<< ++x % --y;
}
};
int main()
{
IndiaBix objBix;
objBix.Tester(5.0, 5.0);
return 0;
}
14.
Which of the following statement is correct about the program given below?
#include<iostream.h>
const double BixConstant(const int, const int = 0);
int main()
{
const int c = 2 ;
cout<< BixConstant(c, 10)<< " ";
cout<< BixConstant(c, 20)<< endl;
return 0;
}
const double BixConstant(const int x, const int y)
{
return( (y + (y * x) * x % y) * 0.2);
}
15.
Which of the following statement is correct about the program given below?
#include<iostream.h>
struct MyStructure
{
class MyClass
{
public:
void Display(int x, float y = 97.50, char ch = 'a')
{
cout<< x << " " << y << " " << ch;
}
}Cls;
}Struc;
int main()
{
Struc.Cls.Display(12, 'b');
return 0;
}
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers