Contact Us || Privacy Policy || About Us |
|
Array in C++An Array is collection of store multiple values in a single variable, instead of declaring separate variables for each value. ![]() In C++, array index starts from 0. Advantages of C++ Array
Disadvantages of C++ Array
Types of Array in C++There are two types of arrays in C++ programming:
1) Single Dimensional Array in C++A single-dimensional array is the simplest from of array that requires only one subscript to access an array element. Output: Enter the marks of your 6 subjects:: 5 6 7 8 9 10 Average Marks is::7.5 Multidimensional ArraysMulti-dimensional arrays can be described as arrays of arrays . In multidimensional array store data in tabular form rows and columns Output: arr[0][0]: 11 arr[0][1]: 22 arr[0][2]: 33 arr[1][0]: 44 arr[1][1]: 55 arr[1][2]: 66 Output: the resultant matrix is 6 8 10 6 4 14 14 16 4
Next TopicArray of Strings in C++
|