Các bạn thảo luận đáp án nhé, bài test lấy từ http://www.indiabix.com/online-test/c-programming-test/13
6.What will be the output of the program in Turbo-C ?
#include<stdio.h>
int main()
{
int arr[5], i=-1, z;
while(i<5)
arr[i]=++i;
for(i=0; i<5; i++)
printf("%d, ", arr[i]);
return 0;
}
- A. 1, 2, 3, 4, 5,
- B. 1, 0, 1, 2, 3, 4
- C. 0, 1, 2, 3, 4,
- D. 0, -1, -2, -3, -4,