55.7k views
1 vote
Write a statement to print the data members of InventoryTag. End with newline. Ex: if itemID is 314 and quantityRemaining is 500, print:

User Rylexr
by
3.9k points

1 Answer

5 votes

Answer:

The program bellow was developed in C

Step-by-step explanation:

//for this lets take as example the presence of the red sweeter in an inventory

#include <stdio.h>

typedef struct IvntTag_struct

{

int elementID;

int remainingQnt;

} IvntTag;

int

main (void)

{

IvntTag redSweater;

redSweater.elementID = 314;

redSweater.remainingQnt = 500;

printf ("element ID: %d, quantity: %d\\", redSweater.elementID,

redSweater.remainingQnt);

getchar ();

return 0;

}

Output

element ID: 314, quantity: 500

User ShortFuse
by
3.8k points