answersLogoWhite

0

Array is the set of multiple values while variable is used to store a single value at a time.

Arrays have subscript while variable doesn't have a subscript.

Syntax of declaring array and variable is different.

For variable:

data_type list of variables;

For array:

Data_type variable1[size], variablen[size];

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

What is syntax in c plus plus for declaring a variable?

type variable {[optional array size]} {= optional initializer};


Define pointer in C?

Pointer is a variable, A variable that stores the address of another variable. Size of a pointer is 2 bytes.


Is an array is a collection of characters that can be fixed or variable?

No. An array is a collection of objects of any type, such as doubles, not just characters. You can even have arrays of arrays, or arrays of structs. In C, the size of an array is fixed, but it is possible to write code that will allow you to manually make it variable in size.


Is the array size is fixed after it is created?

Generally, a array is fixed in size. With some libraries, however, they are extensible, either by reallocation/copying strategies (C/C++/STL), or by linking/referencing strategies (JAVA).


How can I get the size of an array in C?

To get the size of an array in C, you can use the sizeof() operator. This operator returns the number of bytes occupied by the array, so to get the number of elements in the array, you can divide the total size by the size of one element.


How do you convert char array into unsigned char array in c?

You can't convert the data type of any variable.


How do you find the minimum value of an array in c language?

Your best bet would probably be to iterate through the array using a for loop and compare each value to the current low and high values (which you would store in a local variable) for example: for each element in array { if current is less than lowest_value lowest_value = current else if current is greater than highest_value highest_value = current }


C program to copy one matrix to another matrix?

#include main() { int array[100], minimum, size, c, location = 1; printf("Enter the number of elements in array\n"); scanf("%d",&size); printf("Enter %d integers\n", size); for ( c = 0 ; c < size ; c++ ) scanf("%d", &array[c]); minimum = array[0]; for ( c = 1 ; c < size ; c++ ) { if ( array[c] < minimum ) { minimum = array[c]; location = c+1; } } printf("Minimum element is present at location number %d and it's value is %d.\n", location, minimum); return 0; }


What is the syntax for determining the size of an array in C using the keyword sizeof?

To determine the size of an array in C using the keyword sizeof, you would use the syntax: sizeof(array) / sizeof(array0).


Can you give an example of array using character variable in c program?

the example of array over charcter variables is char ["string"]


What is the base address of an array in c program?

the address of variable (pointer) that contains array


How do you swap two adjecent no in array in c?

Option 1) Use a temporary variable: int x = array[i]; array[i] = array[i+1]; array[i+1] = x; Option 2) Use bit operators: array[i] ^= array[i+1] ^= array[i];