11
Loading subject content…
Loading subject content…
Loading practice questions…
What will be the output of the program?
#include <iostream>
using namespace std;
void show(int x) { cout << "int"; }
void show(char x) { cout << "char"; }
int main() {
show('a');
cout << endl;
return 0;
}What will be the output of the program?
#include <iostream>
using namespace std;
int f(int a, int b = 10, int c = 100) { return a + b + c; }
int main() {
cout << f(1) << " " << f(1, 2) << endl;
return 0;
}What will be the output of the program?
#include <iostream>
using namespace std;
int main() {
int total = 0;
auto add = [&total](int v) { total += v; };
add(5); add(7);
cout << total << endl;
return 0;
}