#include #include int main() { int i = 1024; for (; i; i >>= 1) printf(“nlaptrinhc++”); getch(); } How many times will “vncoding” is printed on screen?

#include

#include

int main()

{

int i = 1024;

for (; i; i >>= 1)

printf(“nlaptrinhc++”);

getch();

}

How many times will “vncoding” is printed on screen?

A. 10

B. 11

C. Infinite

Hướng dẫn

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

Xem lời giải

Xem lời giải

Vì  i >>=1 -> i = i >> 1 = i/2. Mà 1024 = 2^10 = 1000000000 -> “laptrinhc++” sẽ được in ra 10 lần.

 

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