Why are there only 15 spaces?

Viewed 51
#include <stdio.h>

int main()
{
int n, i, j, k, count = 0;

for(i = 0; i <= 4; i++){
    if(i == 0 || i == 4){
        for(j = 0; j < 18; j++) printf("*");
        printf("\n");
    }
    else {
        printf("*\t\t*\n");
    }
}
return 0;
}

\t means 8 spaces as far as I know. So the statement printf("\t\t\n") should print two stars at location number 1 and 18; but the output is different

The output is shown in the attached image.In first line, there are 18 stars, in the second, third and fourth line, there are two stars located in position 1 and 17, and in the last line there are again 18 stars

0 Answers
Related