Having the following declarations of variables, what will be printed to the console?
#include <iostream>

int main() {
    int a = 1;
    int b = 2;

    int c = (a,b);
    int d =  a,b;

    std::cout << c;
    std::cout << d;

    return 0;
There will be redefinition of the variable b in the line: int d = a,b;.

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Sign Up Now
or Subscribe for future quizzes