1
0

scan_str.c 305 B

1234567891011121314
  1. /* scan_str.c -- using scanf() */
  2. #include <stdio.h>
  3. int main(void)
  4. {
  5. char name1[11], name2[11];
  6. int count;
  7. printf("Please enter 2 names.\n");
  8. count = scanf("%5s %10s",name1, name2);
  9. printf("I read the %d names %s and %s.\n",
  10. count, name1, name2);
  11. return 0;
  12. }