Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 Follow the instructions below regarding an array called fractions. a ) Define a symbolic constant SIZE with the replacement text 1 0 . b

1 Follow the instructions below regarding an array called fractions.
a) Define a symbolic constant SIZE with the replacement text 10.
b) Define a double array with SIZE elements and initialize the elements to 0.
c) Refer to array element 4.
d) Assign the value 1.667 to array element nine.
e) Assign the value 3.333 to the seventh element of the array.
f) Print array elements 6 and 9 with two digits of precision to the right of the decimal point, and show the output that's displayed on the screen.
g) Print all the elements of an array using a for iteration statement. Use the variable x as the loop's control variable. Show the output.
2 Write statements to accomplish the following:
a) Define table to be an integer array and to have 3 rows and 3 columns. Assume the symbolic constant SIZE has been defined to be 3.
b) How many elements does the array table contain? Print the total number of elements.
c) Use a for iteration statement to initialize each element of table to the sum of its subscripts. Use variables x and y as control variables.
d) Print the values of each element of array table. Assume the array was initialized with the definition: int table[SIZE][SIZE]=,{5};
3 Write statements to accomplish each of the following:
a) Display the value of the seventh element of character array f.
b) Input a value into element 4 of one-dimensional floating-point array b.
c) Initialize each of the five elements of one-dimensional integer array g to 8.
d) Total the elements of floating-point 100-element array c.
e) Copy array a into the first portion of array b. Assume a has 11 elements, b has 34 elements, and both arrays have the same element type.
f) Determine and print the smallest and largest values contained in 99-element floating-point array w.
4 Consider a 2-by-5 integer array t.
a) Write a definition for t.
b) How many rows does t have?
c) How many columns does t have?
d) How many elements does t have?
e) Write the names of all the elements in the second row of t.
f) Write the names of all the elements in the third column of t.
g) Write a single statement that sets the element of t in row 1 and column 2 to 0.
h) Write a series of statements that initialize each element of t to zero. Do not use an iteration statement.
i) Write a nested for statement that initializes each element of t to zero.
j) Write a statement that inputs the values for the elements of t from the terminal.
k) Write a series of statements that determine and print the smallest value in array t.
l) Write a statement that displays the elements of the first row of t.
m Write a statement that totals the elements of the fourth column of t.
5 Find the error in each of the following program segments and correct the error:
IN C programing
image text in transcribed

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

Step: 3

blur-text-image

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

Big Data, Mining, And Analytics Components Of Strategic Decision Making

Authors: Stephan Kudyba

1st Edition

1466568704, 9781466568709

More Books

Students also viewed these Databases questions

Question

10. True or false? If the statement is false, explain why: LO4

Answered: 1 week ago

Question

Did the school meet Adequate Yearly Progress (AYP)?

Answered: 1 week ago