void main() { int x = 0, y = 0; if(x == 0 || ++y) printf(“x=%d”, x); printf(” y=%d”, y); getch(); } What is output?

void main()

{

int x = 0, y = 0;

if(x == 0 || ++y)

printf(“x=%d”, x);

printf(” y=%d”, y);

getch();

}

What is output?

A. x=0 y=1

B. x=0 y=0

C. Error syntax

Hướng dẫn

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

Xem lời giải

Xem lời giải

Biểu thức so sánh x == 0 là TRUE nên biểu thức ++y sẽ không được thực hiện.

 

Thư viện tài liệu12 Tháng bảy, 2023 @ 3:03 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