I am a newbie to C and want to print some special elements of an array.
//Partial code here
char aaa[18] ;
int i = 0;
while(i < 18) {
aaa[i] = '#' ;
printf("%c", aaa[i]) ;
i = i + 4 ;
}
It's supposed to prints 4 # of aaa[0] ,aaa[4],aaa[8],aaa[12],aaa[16]. But it is not. It is printing them in a row like #####. But I don't want those .
printf("%c " , aaa[i] ) ;It will add space between array elements and If you need newline useprintf("%c \n" , aaa[i] ) ;