void main() { int x=0; { int x = 0, y = 0; y++; x++; } printf(“%d”, x); getch(); } Output of following code?

void main()

{

int x=0;

{

int x = 0, y = 0;

y++;

x++;

}

printf(“%d”, x);

getch();

}

Output of following code?

A. 1

B. Error

C. 0

Hướng dẫn

Chọn C là đáp án đúng

Xem lời giải

Xem lời giải

Giải thích: biến x được khai báo trong ngoặc {} là biến local, hàm printf() sẽ lấy giá trị x = 0.

 

Thư viện tài liệu12 Tháng bảy, 2023 @ 3:00 chiều

Đánh giá chủ đề này
How to whitelist website on AdBlocker?

How to whitelist website on AdBlocker?

  1. 1 Click on the AdBlock Plus icon on the top right corner of your browser
  2. 2 Click on "Enabled on this site" from the AdBlock Plus option
  3. 3 Refresh the page and start browsing the site