Question: in C language Write two statements to assign numApples with 10 and numOranges with 3. Sample output for given program: Apples: 10 Oranges: 3 #include

in C language

Write two statements to assign numApples with 10 and numOranges with 3. Sample output for given program:

Apples: 10 Oranges: 3 

#include #include

typedef struct bagContents_struct { int numApples; int numOranges; } bagContents;

void bagContents_PrintBag(bagContents* itemPtr) { if (itemPtr == NULL) return;

printf("Apples: %d ", itemPtr->numApples); printf("Oranges: %d ", itemPtr->numOranges);

return; }

int main(void) { bagContents* groceryPtr = NULL;

groceryPtr = (bagContents*)malloc(sizeof(bagContents));

/* Your solution goes here */

bagContents_PrintBag(groceryPtr);

return 0; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!