I was given this code to start:
char s[21];
for ( k = 0; k < 20; k++ )
s[k] = ' ';
s[20] = '\0';
printf("|%s|\n", s);
I have to include the following into the code i have:
- place 5 random characters within string s
- symbol should be a lowercase character
- location/position must be within valid string
The final code should generate (without the periods, just spaces):
|...................|
|..l..gy..x...c|
the letters and spacing can be random, but must stay within the string
What I have tried:
I haven't been able to get past this:
char s[21];
for ( k = 0; k < 20; k++ )
s[k] = ' ';
s[20] = '\0';
printf("|%s|\n", s);
printf("\n");
return 0;
}
Any help would be appreciated as I really struggle with coding. Thanks!