Skip to main content

Posts

Showing posts with the label Class 12th Chapter 9 Working with Array and String

ads1

Class 12th Chapter 9 Working with Array and String

An array is a variable representing a collection of homogeneous type of elements. Arrays are useful to represent vector, matrix and other multi-dimensional data. Vector is a one dimensional (1-D) data structure that can be used to store list of items like characters, numbers. Arrays are useful when same operations are to be performed on various elements of the similar type. Creating an array is a two step process: 1. Declare an array object 2. Create an array object An array object can be created in two ways: 1. Using new operator and specifying the size 2. Directly initializing the content of array   To declare a 1-D array we use a pair of square brackets [ ] after array name or after data type.  Choose the most appropriate from those given below : (1) Which of the following refer to the starting index value in arrays ? (a) 0 (b) 1 (c) null (d) All of these (2) What is the size of second dimension in an array sales[5][12] ? (a) 5 (b) 12 (c) 60 (d) 10 (3) What will expression sales.len

ads2