In which of the numbered lines below can 'y' variable be accessed/used​?
int main(int argc, char** argv)
{
    if ( argc > 2 ) 
    {
    }
    else if (int y = argc - 1) 
    {
        // 1
    }
    else 
    {
        // 2
    }

    // 3

    return 0;
}
Explanation
The variables defined in the "if" / "else if" conditions, are only available in the current "if" block and in the subsequent "else if" blocks.

Follow CodeGalaxy

Mobile Beta

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