+ 4

how to define length of an array after taking an input from the user

2nd Apr 2020, 7:42 AM
Addaganti Naga Sai Rajeev
Addaganti Naga Sai Rajeev - avatar
4 Respostas
+ 4
(1) Declare an int n (2) Input value and store it in n (3) Declare array int arr[n];
2nd Apr 2020, 8:02 AM
Bhavya
Bhavya - avatar
+ 5
Yes
2nd Apr 2020, 7:49 AM
Addaganti Naga Sai Rajeev
Addaganti Naga Sai Rajeev - avatar
+ 2
Is user input a number that defines the array length? if not, can you please describe what you want to do clearly.
2nd Apr 2020, 7:48 AM
Ipang