Question: 8. Study the following code. Explain what this code does in general and each block of the code. You don't need to explain the
8. Study the following code. Explain what this code does in general and each block of the code. You don't need to explain the algorithm used. (15points) #define ARSIZE 10 int ch_arr[ARSIZE], count1; int count2, stop, lastchar; lastchar =0; stop = 0; while(stop != 1) { } ch_arr[lastchar] = getchar(); if (ch_arr[lastchar] == ' ') stop = 1; else lastchar lastchar + 1; if(lastchar == ARSIZE) stop = 1; lastchar lastchar-1; count1 = 0; while (counti < lastchar) { count2 count1 + 1; while (count2 ch_arr[count2]) { int temp; temp ch_arr[count1]; ch_arr[count1] = ch_arr[count2]; ch_arr[count2] = temp; } count2 count2 + 1; } } count1 = count1 + 1; count1 = 0; while(count1
Step by Step Solution
There are 3 Steps involved in it
The purpose of the C program given is to establish a fundamental system for entering arranging and displaying characters More precisely the program is designed to Set up variables and an array for sto... View full answer
Get step-by-step solutions from verified subject matter experts
