Originally Posted by
rags_to_riches
Incorrect, it should be
Maybe you should copy and paste your assignment. You may be misunderstanding it.
Thanks for the correction. I had some help and this is the end result.
Code:
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#define BLANK ' '
int main()
{
char init,ch;
printf("Enter First Name followed by Last Name:");
init=getchar(); /* Init is initial. */
while((ch=getchar())!=BLANK) /* Initials the first name */
;
while((ch=getchar())==' ') /* Creates the space between the name */
;
printf("%c",ch);
while((ch=getchar())!='\n')
printf("%c",ch);
printf("%c.\n", init); /* Creates the initial with the first name */
}