Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(please answer all given questions) if we have the statement int k[8] = {1, 2, 3, 4, 5, 6, 7, 8}; what is the value

(please answer all given questions)

if we have the statement int k[8] = {1, 2, 3, 4, 5, 6, 7, 8}; what is the value in k[4]?

Question options:

4

garbage

5

3

Question 16 0 / 3 points

if we have the statement int k[8] = {}; what is the value in k[4]?

Question options:

0

garbage

a space

3

Question 17 0 / 3 points

if we have the statement int k[8] = {1, 2, 3}; what is the value in k[4]?

Question options:

0

garbage

a space

3

Question 18 3 / 3 points

if we have the statement int k[8]; will the C statement k[14] = 44; compile?

Question options:

yes

no

Question 19 3 / 3 points

does C do array bounds checking???

Question options:

yes

no

ArraysSA
Question 20 0 / 2 points

given int k[5] = {2, 5, 1, 7, 9};

add the element with the value of 2 to the element with the value of 9 and store the sum in the element with the value of 2

Question options:

k[1] = k[5] + k[1];

k[0] = k[5] + k[1];

k[6] = k[5] + k[1];

k[0] = k[4] + k[0];

Question 21 0 / 2 points

given int k[5] = {2, 5, 1, 7, 9};

assign the value 666 to the element in the array that currently has the value of 9

Question options:

K[0] = 666;

K[1] = 666;

K[4] = 666;

K[5] = 666;

Question 22 0 / 27 points

array coding matching

_____

char ch [10]

_____

k[0][0] = 44;

_____

k[2][5] = 44;

_____

int k[5];

_____

float flt [2][6];

_____

k[4] = k[0] + k[6];

_____

k[0] = 123;

_____

k[0][1] = 44;

_____

int k[7] = {2, 89, 1, 7890, 6, 900, 56}

or

int k[] = {2, 89, 1, 7890, 6, 900, 56}

1.

Code the statement(s) to define an array ofcharacters named ch which has 10 elements.

2.

Assume that the statements necessary to define an array of int's named k which has 7 elements and initialized them with the following values: 2, 89, 1, 7890, 6, 900, 56 HAS ALREADY BEEN CODED

code the statement to change the value of the element of the array that has 2 to 123

3.

Assume that the statements necessary to define an array of int's named k which has 7 elements and initialized them with the following values: 2, 89, 1, 7890, 6, 900, 56 HAS ALREADY BEEN CODED

code the statement to add the element containing the value 2 to the element containing the value 56, and store the value in the element containing 6

4.

Code the statements necessary to define an array of int's named k which has 7 elements and initialize them with the following values in one C statement 2, 89, 1, 7890, 6, 900, 56

5.

Code the statement(s) to define an array of ints named K which has 5 elements

6.

Code the statement(s) to define a two dimensional array of floats named flt that has 2 rows and 4 columns.

7.

assume a 2 dimensional array of ints named k has been defined with 3 rows and 6 columns. Code the statement to assign the value 44 to the array element in the first row and the second column

8.

assume a 2 dimensional array of ints named k has been defined with 3 rows and 6 columns. Code the statement to assign the value 44 to the array element in the first row and the first column

9.

assume a 2 dimensional array of ints named k has been defined with 3 rows and 6 columns. Code the statement to assign the value 44 to the array element in the last row and the last column

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What is the exception to the single fair value measure rule?

Answered: 1 week ago