main()
{
int no;
char name1[15], name2[15], name3[15];
printf("Enter serial number and name one\n");
scanf("%d %15c", &no, name1);
printf("%d %15s\n\n", no, name1);
printf("Enter serial number and name two\n");
scanf("%d %s", &no, name2);
printf("%d %15s\n\n", no, name2);
printf("Enter serial number and name three\n");
scanf("%d %15s", &no, name3);
printf("%d %15s\n\n", no, name3);
}
Output
Enter serial number and name one
1 123456789012345
1 123456789012345r
Enter serial number and name two
2 New York
2 New
Enter serial number and name three
2 York
Enter serial number and name one
1 123456789012
1 123456789012 r
Enter serial number and name two
2 New-York
2 New-York
Enter serial number and name three
3 London
3 London