EBK C HOW TO PROGRAM
EBK C HOW TO PROGRAM
8th Edition
ISBN: 8220100663833
Author: Deitel
Publisher: PEARSON
bartleby

Videos

Textbook Question
Book Icon
Chapter 6, Problem 6.6E

Fill in the blanks in each of the following:

  1. C stores lists of values in _______.
  2. The elements of an array are related by the fact that they _____.
  3. When referring to an array element, the position number contained within square brackets is called a(n) __________.
  4. The names of the five elements of array p are ___, ____, ___, _____ and ____.
  5. The contents of a particular element of an array is called the _____ of that element.
  6. Naming an array, stating its type and specifying the number of elements in the array is called _____ the array.
  7. The process of placing the elements of an array into either ascending or descending order is called ____.
  8. In a two-dimensional array, the first index identifies the _____ of an element and the second index identifies the _____ of an element.
  9. An m-by-n array contains _____ rows, _____ columns and _____ elements.
  10. The name of the element in row 3 and column 5 of array d is ___.

a)

Expert Solution
Check Mark
Program Plan Intro

To fill in the blanks with appropriate word.

Program Description Answer

C stores the list of values in _Arrays.

Explanation of Solution

Arrays in C stores the homogenous data type of values in consecutive memory locations.Thus, the correct fill up is arrays.

b)

Expert Solution
Check Mark
Program Plan Intro

To fill in the blanks with appropriate word.

Program Description Answer

The elements of the array are related by the fact that they areHomogeneous.

Explanation of Solution

Arrays in C stores the homogenous data type (of the same type) of values in consecutive memory locations e.g. they can contain the same kind of elements like integers, characters, doubles and floats. etc.

Thus, the correct fill up is homogeneous.

c)

Expert Solution
Check Mark
Program Plan Intro

To fill in the blanks.

Program Description Answer

When referring to an array element, the position number contained within square brackets is called aSubscript.

Explanation of Solution

The elements in an array are accessed using the index value contained within the square bracket known as a subscript. It is used to identify the index of the element.

Thus, the correct fill up is subscript.

d)

Expert Solution
Check Mark
Program Plan Intro

To fill in the blanks.

Program Description Answer

The names of five elements of array p are p[0], p[1],p[2],p[3] and p[4].

Explanation of Solution

The elements of the array are accessed using the subscript which start from 0 to length-1.Thus, the correct fill up is p[0],p[1],p[2], p[3] and p[4]..

e)

Expert Solution
Check Mark
Program Plan Intro

To fill in the blanks.

Program Description Answer

The contents of the particular element of the array are called as thevalueof the element in the array.

Explanation of Solution

The content of the element of an array is called the value. For example a is an array and the element at its first positive contains the content 2. So the value will be 2.Thus, the correct fill up is value.

f)

Expert Solution
Check Mark
Program Plan Intro

To fill in the blanks.

Program Description Answer

Naming an array, stating its type and specifying the number of elements in the array is called thedeclarationof the array.

Explanation of Solution

Declaration syntax of an array is as follows-

type arrayname[size];

For example,intarr[5]; //declaration of integer array of size 5.

Thus, the correct fill up is Declaration.

g)

Expert Solution
Check Mark
Program Plan Intro

To fill in the blanks.

Program Description Answer

The process of placing the elements of an array either in ascending order or descending order is calledSorting.

Explanation of Solution

Sorting is the process of arranging the element either in increasing or decreasing order. Thus, the correct fill up is sorting.

h)

Expert Solution
Check Mark
Program Plan Intro

To fill in the blanks.

Program Description Answer

In a two-dimensional array, the first index identifies therow of an element and the second element identifies thecolumnof an element.

Explanation of Solution

The elements in two-dimensional array are stored in rows and column.

Following is the assignment in a 2D array.

a[0][1]=5;

Here 0 is the row number and 1 is the column number and at this position value 5 is stored.Thus, the correct fill up is rowandcolumn.

i)

Expert Solution
Check Mark
Program Plan Intro

To fill in the blanks.

Program Description Answer

An m by n array contains_m_ rows, _n_ columns and _m*n__ elements.

Explanation of Solution

The number of elements in 2 d array is always the product of the number of rows and columns.Thus, the correct fill up arem, n and m*n.

j)

Expert Solution
Check Mark
Program Plan Intro

To fill in the blanks.

Program Description Answer

The name of an element in row 3 and column 5 of array d isd[2][4].

Explanation of Solution

The array indices always start from 0, so the element in 3rd row and 5th column of 2 d array d will be denoted by d[2][4].

Thus, the correct fill up is d[2][4].

Want to see more full solutions like this?

Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
09:44
Students have asked these similar questions
CODE IN C++.Write the code to copy values in one array to another. In the following code snippet, we copy values from intArr1 to intArr2. Also, intArr1 will no longer be used and therefore the memory used for intArr1 should be deallocated....int * intArr1 = new int [2];// assign values to intArr1...int * intArr2; // now write the code for allocating space for intArr2, ­­­copying values from intArr1 to intArr2, and for deallocating space used by intArr1.
Given these two arrays, char arrA[] = {'a', 'e', 'i', 'o', 'u'} and char arrB[] = {'T', 'A', 'B','L','E'}, merge these two arrays into a new array. Make sure that the contents of arrA is interspersed with contents of arrB.
5. Using c++, Write a function that determines the index of the second to the last occurrence of a target b in an integer array a. Return -1 if b is not in a or there is only 1 occurrence of b in a.

Chapter 6 Solutions

EBK C HOW TO PROGRAM

Additional Engineering Textbook Solutions

Find more solutions based on key concepts
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
1.1 Arrays in Data Structure | Declaration, Initialization, Memory representation; Author: Jenny's lectures CS/IT NET&JRF;https://www.youtube.com/watch?v=AT14lCXuMKI;License: Standard YouTube License, CC-BY
Definition of Array; Author: Neso Academy;https://www.youtube.com/watch?v=55l-aZ7_F24;License: Standard Youtube License