Hi, I'm new to the community and to C. i have no programing background what so ever but i have been reading books on it. I am trying to use a for loop to print out the folowing
*******
(space)*******
(space)(space)*******
(space)(space)(space) *******
I wrote the program
#include <stdio.h>
int main(void)
{
char stars[]= "*******", spaces[5]=" ";
int i;
for ( i=0; i < 4; i++){
printf("%s%s\n", spaces, stars);
spaces= ' ';
spaces[i+i]=' ';
return 0;
}
}
when i try to compile it i get alot of errors and i have no idea how to fixed them. Can someone please tell me where i might have made a mistake. For some reason i cant use any of the message editor functions on this thread. the format is screwed up. i had to include (space) to show where i wanted the space to be