what is the syntax to accomplish the following tasks ? ( In c# Please ) answer D
ID: 3904662 • Letter: W
Question
what is the syntax to accomplish the following tasks ? ( In c# Please ) answer D and E only please 13) What is the syntax to accomplish the following tasks? (10 pts.) a) Display the value of element of string array my StxingAtax with index 5 , numl, mun2 SD. b) Initialize each of the ten elements of one-dimensional integer array mylatAray, to 10 int mylntArray new int [10] Arrays.fill my IntArray,10) c) Total all the elements from step b d) Increase the size of array in step b to 100 elements, assuming that the size of the array was referenced to a constant size e) Initialize all elements in step d to 5Explanation / Answer
d) Increase the size of array in step b to 100 elements:-
int myIntArray = new int[10]; // Declare an array of 10 elements
Array.Resize(ref myIntArray , 100); // Dynamically resize the array myIntArray to store 100 elements
e) Initialize all ements in step D to 5
for (int i = 0; i < 100; i++){
myIntArray[i] = 5;
}
Please let me know in case of any clarifications required. Thanks!
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.