void main() { int i = 10, j = 20; if(i = 20) printf(” Hello”); else printf(” Hi”); getch(); } What is output ?

void main()

{

int i = 10, j = 20;

if(i = 20)

printf(” Hello”);

else

printf(” Hi”);

getch();

}

What is output ?

A. Hello

B. Hi

C. Complier error

Hướng dẫn

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

Xem lời giải

Xem lời giải

i = 20 là biểu thức gán (không phải biểu thức so sánh). Giá trị của biểu thức này trả về là #0.Nên lệnh printf(” Hello”); đượ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