Curioustab
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Take Free Test
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Take Free Test
Functions Questions
C++ default arguments: which statement below is incorrect regarding default function arguments?
C++ default arguments: which statement is correct about redefinition and using function calls as defaults?
C++ default parameters: identify which declarations are invalid and choose the best summary.
C++ default arguments usage: in what effective order do omitted arguments get supplied at the call site?
C++ overloading limits: which of the following functions cannot be overloaded? (Choose the only correct option.)
C++ function overloading: which statement about parameter counts and types is correct?
In C++ default-argument rules, which of the following statements is incorrect? Read carefully and select the option that violates how default parameters work in real code.
Default parameters in C++: which statement is correct about how many parameters may be defaulted? Choose the rule that best reflects the language design.
Function overloading: which statement is correct under standard C++ rules? Assume normal overload resolution; default arguments do not change a function’s signature.
If a function has three parameters, which position(s) may legally have default arguments under standard C++ rules? Choose the most accurate statement.
Which statement is correct about constructors and default parameters in C++? Pick the option that matches the language capabilities.
Const-correctness for function parameters in C++: which statement is correct? Focus on what it means to accept constants and the restrictions on modification.
Default arguments: which statement is incorrect with respect to declaration and usage sites? Pick the option that violates best practice or standard rules.
Overloading with default arguments: which statement is correct under C++ rules? Assume you avoid ambiguity by careful design.
Where should the default value of a function parameter be specified in C++? Choose the place(s) allowed by the language (avoid duplicating across declarations).
Which of the following function prototypes is perfectly acceptable in C++ for using a default argument? Assume referenced names are declared before the prototype.
C++ default parameters: which function(s) cannot legally have default arguments?
Which of the following statement is correct about the program given below? #include
static int Result; class India { public: void Change(int x = 10, int y = 20, int z = 30) { cout<< x + y + z; } void Display(int x = 40, float y = 50.00) { Result = x % x; cout<< Result; } }; class CuriousTab { int x, y; public: void Change(int x, int y = 50) { cout<< x + y; } }; class CuriousTab: public India, public CuriousTab { public: void Display(int x = 10, int xx = 100, int xxx = 1000) { Result = x + xx % x * x; cout<< Result ; } }; int main() { CuriousTab objCuriousTab; objCuriousTab.India::Display(10, 20.00); return 0; }
What will be the output of the following program? #include
class CuriousTabSample { public: int a; float b; void CuriousTabFunction(int a, float b, float c = 100.0f) { cout<< a % 20 + c * --b; } }; int main() { CuriousTabSample objCuriousTab; objCuriousTab.CuriousTabFunction(20, 2.000000f, 5.0f); return 0; }
What will be the output of the following program? #include
class CuriousTab { public: int x, y; CuriousTab(int xx = 10, int yy = 20) { x = xx; y = yy; } void Exchange(int *, int *); }; int main() { CuriousTab objA(30, 40); CuriousTab objB(50); objA.Exchange(&objA.x, &objB.y); cout<< objA.x << " " << objB.y << endl; return 0; } void CuriousTab::Exchange(int *x, int *y) { int t; t = *x; *x = *y; *y = t ; }
1
2
3
4