void main() { char s[] = “man”; int i; for(i = 0; s; i++) printf(“%c%c%c%ct”, s, *(s+i), *(i+s), i[s]); getch(); } What will be output when you will execute following c code? nnnn B.  mmm aaa nnn C. mmmm aaa nnn D. Another

void main()

{

char s[] = “man”;

int i;

for(i = 0; s; i++)

printf(“%c%c%c%ct”, s, *(s+i), *(i+s), i[s]);

getch();

}

What will be output when you will execute following c code?

nnnn

B.  mmm aaa nnn

C. mmmm aaa nnn

D. Another

Hướng dẫn

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

Xem lời giải

Xem lời giải

Vòng for() sẽ bắt đầu với i = 0, vòng for() sẽ kết thúc khi s = NULL (kết thúc chuỗi s).

s = *(s+i) = *(i+s) = i[s] : kí tự thứ i của mảng s.

 

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