Computer Science, asked by baluramavath6346, 8 months ago

Difference between ordinary variable and array variable

Answers

Answered by sheenabeno
1

Answer:

Array is different from ordinary variable because Array holds multiple values,whereas an ordinary variable hold a single value.It is true when the elements of the array are treated as individual entities,and when the variables such as an int.It is not generally right to distinguish between a variable and an array.

Ordinary Variable

An Ordinary variable can contain only a single value. However, an Array can contain multiple values, each identified by its own index number.

Array

Array can contain multiple values, each identified by its own index number.

Explanation:

Answered by surajnegi0600
1

Answer:

In summary, ordinary variables can store a single value, while arrays can store multiple values. Arrays are useful when you need to work with a large amount of data of the same type, and you need to access each element by its index.

Explanation:

An ordinary variable is a single memory location that can store a single value of a specific data type. For example, an integer variable can store a single integer value, a string variable can store a single string value, and so on.

An array variable, on the other hand, is a collection of memory locations that can store multiple values of the same data type. An array is defined by its data type, followed by its name, and the size of the array in square brackets. For example, an integer array named "numbers" with a size of 5, would be defined as "int[] numbers = new int[5];". Each element in the array is accessed by its index, which is a zero-based integer value that corresponds to a specific memory location within the array.

More questions and answers

https://brainly.in/question/54872587

https://brainly.in/question/54872587

#SPJ3

Similar questions