/* A program to convert five names from first-name, last-name format into last-name comma first-initial format. */ #include main () { char first_name[41], last_name[41]; int counter; /* To count the five iterations of the loop */ /* Loop five times, one name each time */ for (counter = 0; counter < 5 ; counter ++) { /* Input a name */ scanf("%40s%40s", first_name, last_name); /* Output it rearranged */ printf("%s, %.1s\n", last_name, first_name); } }