/* 1: why is the second printf on a newline */
/* 2: each fgets reads 10 chars and retains the '\n' if I input say */
/* qwertyuiop why is the second fgets skipped I think this has something to */
/* do with retaining the '\n' from above, but what?*/
/* 3: Why does'nt the third printf print on the same line */
/* 4: And finally if more chars are entered than fgets can accept */
/* are they automatically flushed from fgets because it adds '\0' */
#include<stdio.h>
#include<conio.h>
int main()
{
char first_name[10];
char last_name[10];
int age;
printf("Input first name :>");
fgets(first_name,11,stdin);
printf("Input last name :>");
fgets (last_name,11,stdin);
printf("Input age :>");
scanf("%d",&age);
printf("first name :>%s last_name :>%s age :>%d",first_name,last_name,age);
getch();
return 0;
}
/* Thanks for the help all. */