C++ Programming :: Functions - C++
-
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 coutint main() {PowerFinder FP; FP.Power(2, 6); return 0; } -
Which of the following statement is correct about the program given below?
#include void Tester(float xx, float yy = 5.0); class Freshergate { float x; float y; public: void Tester(float xx, float 5.0) { x = xx; y = yy; cout int main() { Freshergate objGate; objGate.Tester(5.0, 5.0); return 0; } -
Which of the following statement is correct about the program given below?
#includeconst double GateConstant(const cons0); int main() { const int c = 2 ; cout10 )" "; cout20) return 0; } const double Gateconstant(const int x, const int y) { return( (y + (y * x) * x % y) * 0.2); } -
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" " int main() { Struc.Cls.Display(12, 'b'); return 0; } -
Which of the following statement is correct about the program given below?
#include long FactFinder(long = 5); int main() { for(int i = 0; i0; i++) cout return 0; } long FactFinder(long x) { if(x 2) return 1; long fact = 1; for(long i = 1; i 1; i++) fact = fact * i; return fact; } -
What will be the output of the following program?
#include double GateFunction(double, double= 0, double = 0, double = 0); int main() { double d = 2.3; cout7) " "; cout7, 6) return 0; } double GateFunction(double x, double p, double q, double r, double s) { return p +(q +(r + s * x)* x) * x; } -
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(); coutreturn 0; } float Calculate(float P, int N, float R) { int Year = 1; float Sum = 1 ; Sum = Sum * (1 + P * ++N * R); Year = (int)(Year + Sum); return Year; } -
What will be the output of the following program?
#include class Gate { int x, y; public: void show(void); void main(void); }; void Gate::show(void) { Gate b; b.x = 2; b.y = 4; cout" " void Gate::main(void) { Gate b; b.x = 6; b.y = 8; b.show(); } int main(int argc, char *argv[]) { Gate run; run.main(); return 0; } -
Which of the following statement is correct about the program given below?
#include classFreshergateSample { private: int AdditionOne(int x, int y = 1) { return x * y; } public: int AdditionTwo(int x, int y = 1) { return x / y; } }; int main() { Freshergateesample objGate; cout4, 8)" "; cout8, 8); return 0; } -
What will be the output of the following program?
#include class Freshergate { int K; public: void GateFunction(float, int , char); void GateFunction(float, char, char); }; int main() { FreshergatebjIB; objIB.GateFunction(15.09, 'A', char('A' + 'A')); return 0; } void Freshergate:Gatefunction(float, char y, char z) { K = int(z); K = int(y); K = y + z; cout"K = "

Whatsapp
Facebook