void main() { char s[] = "man"; int i; for(i = 0; s<em>; i++) printf("%c%c%c%c\t", s<em>, *(s+i), *(i+s), i[s]); getch(); }</blockquote> What

Đỗ V.Anh

New member
void main()
{
char s[] = "man";
int i;
for(i = 0; s<em>; i++)
printf("%c%c%c%c\t", s<em>, *(s+i), *(i+s), i);
getch();
}</blockquote>
What will be output when you will execute following c code?
nnnn
B. mmm aaa nnn
C. mmmm aaa nnn
D. Another
 

Quang Khánh

New member
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<em> = NULL (kết thúc chuỗi s).
s<em> = *(s+i) = *(i+s) = i : kí tự thứ i của mảng s.