Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

write the code using c also i need the answer with commonet to understant them c

ID: 3638284 • Letter: W

Question

write the code using c

also i need the answer with commonet to understant them

commmeneded code

Explanation / Answer

Hi, my friend here is the program u want if u need more help message me if u faced any compilation errors message me with the compiler that u use so i can help u PLEASE RATE #include void printArray(int arr[], int size, int L, int kth); int main () { int value[55]; int userInput; int elementsPerLine; int k; int counter = 0; //Get the user input //counter will be the number of elements they entered while(counter < 55) { printf("Please enter the %ith value: ", counter); scanf("%i", &userInput); if(userInput < 0) { break; } else { value[counter] = userInput; printf(" "); ++counter; } } userInput = 0; //reset the input while(userInput < 1 || userInput > 10) { printf(" Please enter the number of elements to print per line: "); scanf("%i", &userInput); } elementsPerLine = userInput; //If it makes it to here, their input was valid printArray(value, 55, elementsPerLine, k); //Print the array from the beginning userInput = 0; // reset the input while(userInput < 1 || userInput > 54) { printf(" Please enter the element to start printing from "); scanf("%i", &userInput); } k = userInput; //This is what element to start the printing from printArray(value, 55, elementsPerLine, k); return 0; } //The function to print the array to the screen //L is the number of elements per line void printArray(int arr[], int size, int L, int kth) { if(kth > 0) { --kth; } //So it prints from the correct element int count = 0; //while(count < 55) for(; count < 55-kth; ++count) { //if(count < 55) if(count % L == 0) { printf(" "); } printf("%i ", arr[count+kth]); // else if(count == 55) break; } printf(" "); }