Use the code below to answer the questions. a. #include <stdio.h> c.void main (v
ID: 3761464 • Letter: U
Question
Use the code below to answer the questions.
a. #include <stdio.h>
c.void main (void)
d.{
e.char name[ ] = “Smithson”;
f.printf(“%c”, name [ 6 ] );
g.printf(“AAAA”, name);
h.int type = checkArray( name );
j.scanf( “%s”, &name );
m.}
a. (1 point) What will the printf () on line “f” display?
b. (1 point) What should replace the “AAAA” in the printf() statement on line g to get it to work
properly?
c. (1 point) How many characters are in array “name [ ]” defined on line e?
d. (1 point) Write the prototype for the function being called on line h.
e. (1 point) How will function checkArray be able to find the end of array “name[ ]”?
f. (1 point) Which line of code will cause a compile error?
Use the array below to answer the next several questions:
array1 [ 3 ] [ 3 ] = { 1, 2, 3, 4, 5, };
a) (1 point)How many values, AT THE MOST, can array1 hold – its capacity?
b) (1 point) What value is in position array1 [ 1 ] [ 1 ] ?
c) (1 point) What is the index value of the LAST position in this array?
(1 point) When an array is passed to a function, it is done automatically as a
a) call by value
b) call by reference
c) you can’t do this in C
d) none of the above
Please, I need the answers to these question with details of each solution. Thanks a lot!
Explanation / Answer
1.a o
1.b %s
1.c 8
1.d int checkArray(char *s);
1.e using strlen(s)-1 will give the last index.
1.f j because array does not required & in front of them while being used within scanf.
2.a 9
2.b 5
2.c array1[2][2];
3.a call by reference
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.