#include #include int main() { char c = 48; int i, mask = 01; for(i = 1; i <= 5; i++) { printf(“%c”, c|mask); mask = mask << 1; } getch(); }  What is output?

#include

#include

int main()

{

char c = 48;

int i, mask = 01;

for(i = 1; i <= 5; i++)

{

printf(“%c”, c|mask);

mask = mask << 1;

}

getch();

}

 What is output?

A.  12480

B. 1248@

C. 12500

D. 12522

Hướng dẫn

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

Xem lời giải

Xem lời giải

Giải thích:

c|mask = 49 -> in ra 1, mask = mask<<1 = 2

c|mask = 50 -> in ra 2, mask = mask<<1 = 4

c|mask = 52 -> in ra 4, mask = mask<<1 = 8

c|mask = 56 -> in ra 8, mask = mask<<1 = 16

c|mask = 48 -> in ra 0, end for()

 

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