Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- void bookStock(int fAry[], int fAry2[], int* bkName)
- {
- for(int i = 0; i <5; i++)
- {
- if(fAry[i] == *bkName)
- {
- printf("There are %d this many books in stock: ", fAry2[i]);
- }
- else
- {
- printf("We do not keep the book in Stock");
- }
- }
- }
- int main(void)
- {
- int* bookName;
- int* address;
- int* bookArray[5] = {12345,13245, 12346, 14567, 16789};
- int* quantityArray[5] = {1, 0 , 6, 4, 3};
- int* bookPrice[5] = {10, 25, 15, 20, 30};
- printf("Please enter a book name(to see if we have it in stock): ");
- scanf("%d %d", bookName, address);
- bookStock(bookArray, quantityArray, bookName);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement