answersLogoWhite

0

in c simply add three lines in the begining of your program:

int x;

printf("enter the size of the array to be entered :");

scanf("%d",&x);

after that use x as your maximum limit of array in your program.

in c++ just replace above printf & scanf statements by

cout<<"enter the size of the array to be entered :";

&

cin>>x;

respectively and do not use brackets.

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

What is the way by which you can make the user defined the size of the arrays?

By using the library function #define A[] we can define the size of arrays


Arrays whose size can be altered are known as?

Arrays whose size can be altered are known as dynamic arrays.


Can an arrays size declarator be negative?

no


How can arrays be used for inter function communication?

The size of a function can be determined from the size of the array. Arrays and functions are both used in computer programming.


What is the median of two sorted arrays of the same size?

The median of two sorted arrays of the same size is the middle value when all the numbers are combined and arranged in ascending order.


What is the required syntax for creating C arrays?

The required syntax for creating C arrays include the brackets, array size, variety length arrays, codes like std:vector, classPTR, and many more to create C arrays.


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.


What is memory leakage in terms of arrays?

leakage in arrays occur when you declare an array with big size and using only very few bytes.


1 write a c function that takes a parameters two integer arrays and their sizeboth arrays are of the same size and returns a 1true if the arrays have the same contents or a 0 false if not?

int comp(const int a1[], const int a2[], const int size) { int i; for(i = 0; i &lt; size; ++i) { if(a1[i] != a2[i]) { return 0; } } return 1; }


How many arrays can you make out of 20?

To calculate the number of arrays that can be made out of 20 elements, we need to consider the possible combinations. Each element can either be included or excluded in the array, resulting in 2 choices for each element. Therefore, the total number of arrays that can be formed is 2^20, which equals 1,048,576.


What number has the most arrays?

You have array of type int with a name myArray, and you do not know size of the array.


Is struct is user defined data type?

yes, a structure is a user-made data type so that user can manipulate multiple data types simultaneously. a structure covers up sum limitation of arrays as in it provides heterogenous data type.