fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4.  
  5. #define CUSHION 50 /* for array sizes*/
  6.  
  7.  
  8. struct book
  9. {
  10. char title[50];
  11. char firstname[50];
  12. char lastname[50];
  13. char isbn[50]; /*ISBN Number consists of 13 numbers*/
  14. char publisher[50];
  15. char dop[50]; /*only the year needed*/
  16. };
  17.  
  18. struct book Book[20];
  19. main()
  20. {
  21. int c=0;
  22. char str[80];
  23. /* for(;c<=20;c++){*/
  24. printf("Title? ");
  25. scanf("%s",Book[c].title);
  26. printf("%s \n",Book[c].title);
  27. printf("Author's first name? ");
  28. scanf("%s",Book[c].firstname);
  29. printf("%s \n",Book[c].firstname);
  30. printf("Author's last name? ");
  31. scanf("%s",Book[c].lastname);
  32. printf("%s \n",Book[c].lastname);
  33. printf("ISBN#: ");
  34. scanf("%s",Book[c].isbn);
  35. printf("%s \n",Book[c].isbn);
  36. printf("Year of publication?: ");
  37. scanf("%s",Book[c].dop);
  38. printf("%s \n",Book[c].dop);
  39. /*}*/
  40. return 0;
  41. }
Success #stdin #stdout 0.01s 1728KB
stdin
mr
wielliam
tell
1337
itsfriday
stdout
Title?   mr 
Author's first name?   wielliam 
Author's last name?   tell 
ISBN#:   1337 
Year of publication?:  itsfriday