3. What are the different ways to initialize an array with all elements in zero? a) int array[5] = {}; b) int array[5] = {0}; (c) 6. An array of similar data types, which are themselves a collection of different data types, are _____ a) Related lists b) Trees c) Structure table d) All view response types mentioned COLOGNE:(LIME, PINE,MUSK,MENTHOL); var a:array[COLOGNE]de REAL; For programming language `C` * Constant expressions are evaluated at compile time * String constants can be concatenated at compile time * Table size must be known at compile time Explanation:- int x[10]; * x stores the base address of the array. *Declarations I, III and IV are not valid. Statement I and III: ++x and x++ throw an error during compilation (lvalue required as incremental operand) Because x is stored in the array address, which is a static value that cannot be changed by the operand. Statement IV: x*2 is also a compilation error (invalid operands in binary * (have `int *` and `int`) Statement II: x+1 is a warning: the assignment makes integer Pointer without flow [enabled by default] Let x be an array. Which of the following is illegal? C++ is a general-purpose programming language developed to enrich the C language with an object-oriented paradigm. It is an imperative and a compiled language. It is a medium language that offers the advantage of programming low-level and even higher applications.

The basic syntax and code structure of C++ and C are identical. 7. Comment on a table of the void data type. a) It can store any type of data b) It only stores items with a data type similar to the first item c) It captures the data type with the highest accuracy d) You cannot have an empty data type table Show response A one-dimensional array A has indexes 1….75.Each element is a string and occupies three words of memory. The array is stored decimal from position 1120. The starting address of A[49] is: Consider the following statement double balance[] = {1000.0, 2.0, 3.4, 17.0, 50.0}; If you omit the array size, a table is created that is just large enough to allow initialization. So the correct option is `A`. Which of the following comments on tables and pointers is/are incorrect? 1.

The two are exactly the same. 2. Array is a constant pointer. 3. The pointer is a one-dimensional array. 4. The pointer is a dynamic table. The minimum number of exchanges required to convert array 89,19,40,14,17,12,10,2,5,7,11,6,9,70 into a heap with the maximum item in the root directory is due to *p containing the base address or storage address of the first item in array A (i.e. a[0]) Return 0; is the “exit status” of the program.

He says the program ends with this statement. Only element 70 violates the rule. Therefore, it must be moved to its correct position. Step 1: swap(10, 70) Step 2: swap(40, 70) Therefore, only 2 swaps are needed. A C++ program must have the main() function. Braces indicate the beginning and end of the function. Code execution is from this function. Step 3: i = ++a[1]; becomes i = ++1; Therefore, i = 2 and a[1] = 2 Step 5: m = a[i++]; becomes m = a[2]; Therefore, m = 15 and i is increased by 1 (i++ means 2++, i = 3) a) 5, 5, 5, 5, 5 b) 5, 0, 0, 0, 0 c) 5, (garbage), (garbage), (garbage), (garbage), 5 See int main() answer { std::cout << "Hello World!"; return 0; }. An element takes up three words from memory, so the location 1120, 1121, 1123 stores the first element. A[49] is stored at site 1264, (1120+(48*3)). Explanation: – The matrix allocates memory at compile time.

1. Some of the functions of the programming language are: (i) Simple (ii) Machine independent, but platform independent (iii) Dependent (iv) Intermediate-level language (v) Extended library support (vi) Execution speed (vii) Pointer and direct memory access (viii) Object-oriented (ix) Compiled language Step 2: int *ptr; *ptr is an integer pointer variable. Step 4: In Fun (&ptr); function printf(“%dn”, **p); Prints the value `1`. a[0] = 5, a[1] = 1, a[2] = 15, a[3] = 20, a[4] = 25. Explanation: – ArrayIndexOutOfBoundsException is a run-time exception and compilation is error-free. String constants can be concatenated at compile time A programming language is a computer language used by programmers (developers) to communicate with computers. It is a set of instructions written in a specific language (C, C++, Java, Python) to perform a specific task. **p contains the value of *p location (i.e. a[0]=1).

std::cout prints the content in quotation marks. Later, << followed by the format string. Here, "Hello World!" is the format string. The #include is a preprocessor directive used to include files in our program. The code above contains the contents of the iostream file. We use #include to use cost, which allows us to print the output on the screen. In C++, every line starting with // is a comment. Comments are used so that the person reading the code understands the functionality of the program. This is completely ignored by the C++ compiler.