home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C Programming Starter Kit 2.0
/
SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso
/
tyc
/
list10_7.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-16
|
505b
|
23 lines
/* Demonstrates using scanf() to input numeric and text data. */
#include <stdio.h>
char lname[81], fname[81];
int count, id_num;
main()
{
/* Prompt the user. */
puts("Enter last name, first name, ID number separated");
puts("by spaces, then press Enter.");
/* Input the three data items. */
count = scanf("%s%s%d", lname, fname, &id_num);
/* Display the data. */
printf("%d items entered: %s %s %d", count, fname, lname, id_num);
}