Advertisement
Guest User

Untitled

a guest
Apr 24th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.63 KB | None | 0 0
  1.  
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. void bookStock(int fAry[], int fAry2[], int* bkName)
  5. {
  6. for(int i = 0; i <5; i++)
  7. {
  8. if(fAry[i] == *bkName)
  9. {
  10. printf("There are %d this many books in stock: ", fAry2[i]);
  11. }
  12. else
  13. {
  14. printf("We do not keep the book in Stock");
  15. }
  16. }
  17. }
  18.  
  19. int main(void)
  20. {
  21. int* bookName;
  22. int* address;
  23. int* bookArray[5] = {12345,13245, 12346, 14567, 16789};
  24. int* quantityArray[5] = {1, 0 , 6, 4, 3};
  25. int* bookPrice[5] = {10, 25, 15, 20, 30};
  26.  
  27. printf("Please enter a book name(to see if we have it in stock): ");
  28. scanf("%d %d", bookName, address);
  29.  
  30. bookStock(bookArray, quantityArray, bookName);
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement