C++ Programming :: Functions - C++
-
What will be the output of the following program?
#include long GateFunction(int x, int y = 5, float z = 5) { return(++x * ++y + (int)++z); } int main() { cout20, 10); return 0; } -
What will be the output of the following program?
#include int GateFunction(int a, int b = 3, int c = 3) { coutreturn 0; } int main() { GateFunction(5, 0, 0); return 0; } -
What will be the output of the following program?
#include void MyFunction(int a, int b = 40) { cout" a = "" b = " } int main() { MyFunction(20, 30); return 0; } -
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" int a = 10, b = 20 ; DisplayData(&a, &b); return 0; } -
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 -
Which of the following statement is correct about the program given below?
#include class Freshergate { public: void Gate(int x = 15) { x = x/2; if(x > 0) Gate(); else cout2; } }; int main() { FreshergateobjIB; objIB.Gate; return 0; } -
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" "; cout return 0; } -
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; cout1)" "; cout3, 4); return 0; } -
Which of the following statement is correct about the program given below
#include
int GateTest(int x, int y);
int GateTest(int x, int y, intz=5);int main(){
cout2, 4)return 0;}int GateTest(int x, int y){return x * y; }int GateTest(int x, int y, int z = ) {return x * y * z;} -
Which of the following statement is correct about the program given below?
#include void Tester(int xx, int yy = 5); class Freshergate { int x; int y; public: void Tester(int xx, int yy = 5) { x = xx; y = yy; coutint main() { Freshergate objGate; objGate.Tester(5, 5); return 0; }

Whatsapp
Facebook