Write in c language please: write a statement that calls the function IncreaseItemQty with parameters computerInfo and addStock. Assign computerInfo with the returned value. #include typedef struct ProductInfo_struct { char itemName[50]; int itemQty; } ProductInfo; ProductInfo IncreaseItemQty(ProductInfo productToStock, int increaseValue) { productToStock.itemQty = productToStock.itemQty + increaseValue; return productToStock; } int main(void) { ProductInfo computerInfo; int addStock; scanf("%s", computerInfo.itemName); scanf("%d", &computerInfo.itemQty); scanf("%d", &addStock); /* Your code goes here */ printf("Name: %s, stock: %d\n", computerInfo.itemName, computerInfo.itemQty); return 0; } thank you in advance
Write in c language please: write a statement that calls the function IncreaseItemQty with parameters computerInfo and addStock. Assign computerInfo with the returned value.
#include <stdio.h>
typedef struct ProductInfo_struct {
char itemName[50];
int itemQty;
} ProductInfo;
ProductInfo IncreaseItemQty(ProductInfo productToStock, int increaseValue) {
productToStock.itemQty = productToStock.itemQty + increaseValue;
return productToStock;
}
int main(void) {
ProductInfo computerInfo;
int addStock;
scanf("%s", computerInfo.itemName);
scanf("%d", &computerInfo.itemQty);
scanf("%d", &addStock);
/* Your code goes here */
printf("Name: %s, stock: %d\n", computerInfo.itemName, computerInfo.itemQty);
return 0;
}
thank you in advance
Step by step
Solved in 3 steps with 1 images