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.


How many arrays can you make with the number 7?

The number of arrays that can be made with the number 7 depends on the context. If you're referring to the number of ways to arrange the number 7 in different combinations or sequences, it could be infinite since you can create arrays of any length, including single-element arrays. If you are asking about distinct arrays of a fixed size using the number 7, then it would depend on the specific constraints, such as the size of the array and whether repetitions are allowed.


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 with 7?

The number of arrays you can create with 7 elements depends on the size of the arrays and the values allowed. If you’re referring to unique combinations of these elements in different arrangements, for example, with distinct values, you could arrange 7 unique elements in (7!) (factorial of 7) ways, which equals 5,040. If the elements can repeat or if the array size varies, the possibilities increase significantly. Please clarify if you meant something specific, such as fixed-length arrays or arrays with certain constraints.


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.