Skip to content
Quiz · Variables and Types · lesson 8 of 9

Quiz — scope and static

Question 1 of 2

What does the program print?

C++
#include <iostream>

int main() {
    int level = 1;
    {
        int level = 2;
        std::cout << level << ' ';
    }
    std::cout << level << '\n';
}

Subscribe to take the course

The course is free. Sign in with Telegram and subscribe to the channel to open every lesson.

Sign in another way