Dear candidates you will find MCQ questions of C++ here. Learn these questions and prepare yourself for coming examinations and interviews. You can check the right answer of any question by clicking on any option or by clicking view answer button.
Share your questions by clicking Add Question
U
Q. What will happen when we use void in argument passing?
U
Q. What is the output of this program?
#include using namespace std; int add(int p, int q); int main() { int n = 15, m = 16; cout << add(n, m) << endl; return 0; } int add(int p, int q ) { int sum = p + q; p = 20; return p + q; }
U
Q. What is the output of this program?
#include using namespace std; void square (int *p) { *p = (*p + 1) * (*p); } int main ( ) { int n = 11; square(&n); cout << n; return 0; }
U
Q. What is the new value of P?
#include using namespace std; void function(int &p) { p = 15; } int main() { int p = 12; function(p); cout << "New value of P is " << p; return 0; }
U
Q. What is the output of this program?
#include using namespace std; void copy (int& p, int& q, int& r) { p = p * 1; q = q * 2; r = r * 3; } int main () { int m = 6, n = 3, o = 2; copy (m, n, o); cout << "M = " << m << ", N = " << n << ", O = " << o; return 0; }
U
Q. By default how the value are passed in c++?
U
Q. Which is used to keep the call by reference value as intact?
U
Q. How many ways of passing a parameter are there in c++?
U
Q. What is the use of the function “showbase”?
U
Q. What is the output of this program?
#include <iostream> using namespace std; int main() { unsigned long num = 56; cout << num << oct <<" " << num << endl; return 0; }
Don't have account? Register here.