What will be the new value of x in the following C++ code?
Posted: Wed Jul 13, 2022 7:51 pm
advertisement
var adpushup = window.adpushup || {};
adpushup.que = adpushup.que || [];
adpushup.que.push(function () {
if (adpushup.config.platform === "MOBILE") {
adpushup.triggerAd("21eae76a-c83f-42b0-aec5-01d590a53f37");
} else if ((window.outerWidth <= 768) || (window.outerWidth == 0)) {
adpushup.triggerAd("21eae76a-c83f-42b0-aec5-01d590a53f37");
}
});
#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; }
a) 10
b) 20
c) 15
d) 36
var adpushup = window.adpushup || {};
adpushup.que = adpushup.que || [];
adpushup.que.push(function () {
if (adpushup.config.platform === "MOBILE") {
adpushup.triggerAd("21eae76a-c83f-42b0-aec5-01d590a53f37");
} else if ((window.outerWidth <= 768) || (window.outerWidth == 0)) {
adpushup.triggerAd("21eae76a-c83f-42b0-aec5-01d590a53f37");
}
});
#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; }
a) 10
b) 20
c) 15
d) 36