#include <string.h>
#include <cs50.h>
#include <stdio.h>
#include <ctype.h>
int main(void)
{
// store user input
char * name = get_string();
// print out the first character of firts string
printf("%c", toupper(name[0]));
// iterate through name
for (int i = 0, n = strlen(name); i < n; i++)
{
// if i'th character is a space print next character as uppercase
if (name[i - 1] == ' ')
{
printf("%c", toupper(name[i]));
}
}
// print new line following initials
printf("\n");
}
It does what it's supposed to do but I'm concerned about the style of the program.