Fill in the blanks in each of the following:
- C stores lists of values in _______.
- The elements of an array are related by the fact that they _____.
- When referring to an array element, the position number contained within square brackets is called a(n) __________.
- The names of the five elements of array p are ___, ____, ___, _____ and ____.
- The contents of a particular element of an array is called the _____ of that element.
- Naming an array, stating its type and specifying the number of elements in the array is called _____ the array.
- The process of placing the elements of an array into either ascending or descending order is called ____.
- In a two-dimensional array, the first index identifies the _____ of an element and the second index identifies the _____ of an element.
- An m-by-n array contains _____ rows, _____ columns and _____ elements.
- The name of the element in row 3 and column 5 of array d is ___.
a)
To fill in the blanks with appropriate word.
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)
To fill in the blanks with appropriate word.
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)
To fill in the blanks.
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)
To fill in the blanks.
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)
To fill in the blanks.
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)
To fill in the blanks.
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)
To fill in the blanks.
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)
To fill in the blanks.
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)
To fill in the blanks.
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)
To fill in the blanks.
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?
Chapter 6 Solutions
C How to Program (8th Edition)
Additional Engineering Textbook Solutions
Problem Solving with C++ (9th Edition)
Starting Out With Visual Basic (8th Edition)
Database Concepts (8th Edition)
Introduction to Programming Using Visual Basic (10th Edition)
Web Development and Design Foundations with HTML5 (9th Edition) (What's New in Computer Science)
Computer Systems: A Programmer's Perspective (3rd Edition)
- (Numerical) Given a one-dimensional array of integer numbers, write and test a function that displays the array elements in reverse order.arrow_forward(Electrical eng.) a. An engineer has constructed a two-dimensional array of real numbers with three rows and five columns. This array currently contains test voltages of an amplifier. Write a C++ program that interactively inputs 15 array values, and then determines the total number of voltages in these ranges: less than 60, greater than or equal to 60 and less than 70, greater than or equal to 70 and less than 80, greater than or equal to 80 and less than 90, and greater than or equal to 90. b. Entering 15 voltages each time the program written for Exercise 7a runs is cumbersome. What method could be used for initializing the array during the testing phase? c. How might the program you wrote for Exercise 7a be modified to include the case of no voltage being present? That is, what voltage could be used to indicate an invalid voltage, and how would your program have to be modified to exclude counting such a voltage?arrow_forwardTwo dimension array in C:Create a two dimension array of integers that is 5 rows x 10 columns.Populate each element in the first 2 rows (using for loops) with the value 5.Populate each element of the last three rows (using for loops) with the value 7.Write code (using for loops) to sum all the elements of the first three columns and output thesum to the screen.arrow_forward
- solition in C++arrow_forwardAssume that the integer array myScores has been declared and assigned values. Assume that the integer variable size has been declared and initialized using the number of elements in the array myScores. Write a code block that declares a pointer to an integer and initializes it using the address of the array. Use that pointer to access the array elements, compute their average (as double), and display it on the screen.arrow_forwardprogramming language C++arrow_forward
- phytonarrow_forwardC PROGRAMMING Instructions: Using the code template below, create a function that computes the average of all the elements in the array using a 'for' loop to sum the array. Use an array pointer to get the values from the array. The average is the return value from the function. Then, implement the function into the main() method. /*_____________________________________________________________________________*/ #include <stdio.h>#include <stdlib.h>int main() { float data[] = {2.5, 3.33, 4.2, 8.0, 5.1}; float sum = 0; printf("Index\tValues\n"); for(int i = 0; i < 5; i++) { printf("%d\t%f", i, data[i]); printf("\n"); sum = sum + data[i]; } sum = sum / 5; printf("Avg\t%f", sum); return 0;}arrow_forwardIn c++arrow_forward
- One dimension array in C:Create an array of 100 integer elements and initialize the array elements to zero.Populate the array (using a for loop) with the values 10,20,30,..., 990,1000.Write code (using for loops) to sum all the elements and output the sum to the screen. without using #definearrow_forwardin c++ language pleaseeeearrow_forwardc++ An array A of size 4 entered by user :1) Print the array.2) print the prime numbers in the array and the count of them . Input : Enter the element : 2 4 3 7 Output : the array is [ 1,3,7 ]The prime number is : 2 3 7The count of prime numbers is : 3arrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,