Please answer with steps in order to show how you arrive to each answer please.
ID: 3891877 • Letter: P
Question
Please answer with steps in order to show how you arrive to each answer please. Thanks in advance.
SECTION II (1 mark per question)s Identify the correct missing line in the following C prograns. missing line must make the resu consistent with the label1ing in the The consistent with e program produce results (no program err of the missing line is indicated by a in the left marg output statements. The position in. 12 include ?include typedef struct car t char color[201 int yeaE char maket201 int main (void) arYellow, 2009, "Volkswagen") car pte: char brand[20] 2 pte printf ("The make of the car is t.", beand); return t0) a) brand x.make b) strepy (brand, ptr->make) i c) strepy (brand, ptr.nake) d) strepy (brand, x-make) e) none of these 13. #include main (void) 101103 50.0 prints ("The tesperature is ue", [01t01) return (0) a) double x/ b) double x(10]: c) double x[101(10]: d) double x[10] [10]: e) none of theseExplanation / Answer
Answer 12.
b) strcpy(brand, ptr->make);
Explaination:
As in this program we are printing the value of 'brand' char array using printf(). So we need the value of 'brand'.
ptr = &x;
In the above statement the address of x (car type struct variable) is stored in pointer varible ptr. Now the member of car structure can refered through pointer variable ptr by using ->.
strcpy() function will copy the value of 'ptr->make' into 'brand' char array.
Answer 13.
d) double x[10][10];
Explaination:
x[0][0] = 50.0;
It will store 50.0 at row number 0 & column number 0, which is a two dimensional array.
So, the correct declaration is double x[10][10];
Answer 14:
d) barney(&n, array);
In this program the value of n printed using printf().
To get the value of n from barney() function we need to pass the address of 'n' & array (called pass by reference) to baney() function because barney() function is not returning any value.
The function prototype of barney() function is void barney(int *x, int y[]) which matches with only barney(&n, array) function call. The return type is void means function does not return any value.
So, The correct option is barney(&n, array);
Answer 15:
c) n = dino(array)
The function prototype of dino() function is int dino(int y[]) which matches with only n= dino(array) function call and dino() function return type is int which returns int value which will be stored in 'n'.
So, The correct option is n = dino(array)