Question 1 of 25
Hints left: 3
Q1
What will be the output of the following C++ code? #include <iostream> using namespace std; void square (int *x) { *x = (*x + 1) * (*x); } int main ( ) { int num = 10; square(&num); cout << num; return 0; } a) 100
Q2
What will be the output of the following C++ code? #include <iostream> using namespace std; void PrintSequence(int StopNum) { int Num; Num = 1; while (true) { if (Num >= StopNum) throw Num; cout << Num; Num++; } } int main(void) { try { PrintSequence(20); } catch(int ExNum) { cout << "Caught an exception with value: " << ExNum; } return 0; }
Q3
What we can't place followed by the non-default arguments?
Q4
What is the default calling convention for a compiler in c++?
Q5
What will be the output of the following C++ code? #include <iostream> using namespace std; #define MAX 10 int main() { int num; num = ++MAX; cout << num; return 0; }
Q6
What will be the output of the following C++ code? #include <iostream> using namespace std; int add(int a, int b); int main() { int i = 5, j = 6; cout << add(i, j) << endl; return 0; } int add(int a, int b ) { int sum = a + b; a = 7; return a + b; }
Q7
How many can max number of arguments present in function in the c99 compiler?
Q8
What will be the new value of x in the following C++ code? #include <iostream> using namespace std; void fun(int &x) { x = 20; } int main() { int x = 10; fun(x); cout << "New value of x is " << x; return 0; }
Q9
To where does the program control transfers when the exception is arisen?
Q10
Which is used to keep the call by reference value as intact?
Q11
What will be the output of the following C++ code? #include <iostream> using namespace std; int max(int a, int b ) { return ( a > b ? a : b ); } int main() { int i = 5; int j = 7; cout << max(i, j ); return 0; }
Q12
What are mandatory parts in the function declaration?
Q13
By default how the value are passed in c++?
Q14
How many types of modularization are there in c++?
Q15
What will we not do with function pointers?
Q16
What will initialize the list of arguments in stdarg.h header file?
Q17
How many types of macros are there in c++?
Q18
What will be the output of the following C++ code? #include <iostream> using namespace std; void fun(int x, int y) { x = 20; y = 10; } int main() { int x = 10; fun(x, x); cout << x; return 0; }
Q19
How many ways of passing a parameter are there in c++?
Q20
which of the following is used to implement the c++ interfaces?
Q21
Which is the correct syntax of declaring a namespace?
Q22
What are the advantages of passing arguments by reference?
Q23
Which header file is used to pass unknown number of arguments to function?
Q24
Overloaded functions are . . . . . . . .
Q25
What is the meaning of the following declaration? int(*ptr[5])();