I am learning C for a class I am taking and a homework assignment asks us to makes a list of integers, divides the list into a number of segments, and displays each segment in reverse order. We need...


I am learning C for a class I am taking and a homework assignment asks us to makes a list of integers, divides the list into a number of segments, and displays each segment in reverse order. We need to use the function malloc to dynamically allocate locations for variables a and b. The full assignment is below. I am not too familiar with C and I don't know how to split the list into two arrays.


AutoSave<br>Project 5<br>Compatibility Mode<br>OFF<br>Home<br>Insert<br>Draw<br>Design<br>Layout<br>References<br>Mailings<br>Review<br>View<br>Tell me<br>2 Share<br>O Comments<br>Times New... v<br>14<br>A A<br>Аa v<br>A<br>AaBbCcDdEe AaBbCcD AaBbCcDdE<br>AaBbCcDdF<br>AaBbCcD<br>AaBbCcDdEe<br>><br>ev A v<br>No Spacing<br>Paste<br>Emphasis<br>Normal<br>Strong<br>Subtitle<br>Title<br>Styles<br>Pane<br>B<br>U<br>v ab x,<br>A<br>Heading 1<br>Dictate<br>Project #5<br>The purpose of this project is to get familiar with the programming language C to be able<br>to learn the next lectures. The following Java program makes a list of integers, divides<br>the list into a number of segments, and displays each segment in reverse order. Convert<br>the program to a C program. Use the built-in function: malloc to dynamically allocate<br>locations for variables: a and b.<br>import java.til.Bandem;<br>public class Main {<br>public static void main(String[] args){<br>int[] a;<br>int[] b;<br>Random r = new Random(Şystem.curcenttieMillis());<br>int alength = CiextInt(10) + 90;<br>int blength = aoextInt(10) + 10;<br>while(alength % blength != 0)<br>alengtb++;<br>a = new int[alenstb];<br>b = new int[blengtb];<br>for(int i = 0; i < audength; i++)<br>a[i] = aextInt(10);<br>erintterwacd(a);<br>for (int index = 0; index < andength; ){<br>for(int į = 0; i < bedensth; i++)<br>b[i] = a[indexti];<br>Brintkaskward(b);<br>index += bulength;<br>}<br>}<br>//9;<br>//2;<br>//Making alength divisible by blength<br>private static void printBaskward(int[] x) {<br>for(int i = Xength<br>Sxsten.Qut.Rcint(x[¿] + = 0; j--) "); - private static void printforward(int[] x) { for(int i = 0; i < xulength;="" i++)="" sustem.qut="" rcint(x[i]="" +="" sustem.auturrintla();="" }="" }="" ",="" ");="" answer:="" page="" 1="" of="" 1="" 204="" words="" e="" english="" (united="" states)="" e3="" focus="" 107%="" "/="">
Extracted text: AutoSave Project 5 Compatibility Mode OFF Home Insert Draw Design Layout References Mailings Review View Tell me 2 Share O Comments Times New... v 14 A A Аa v A AaBbCcDdEe AaBbCcD AaBbCcDdE AaBbCcDdF AaBbCcD AaBbCcDdEe > ev A v No Spacing Paste Emphasis Normal Strong Subtitle Title Styles Pane B U v ab x, A Heading 1 Dictate Project #5 The purpose of this project is to get familiar with the programming language C to be able to learn the next lectures. The following Java program makes a list of integers, divides the list into a number of segments, and displays each segment in reverse order. Convert the program to a C program. Use the built-in function: malloc to dynamically allocate locations for variables: a and b. import java.til.Bandem; public class Main { public static void main(String[] args){ int[] a; int[] b; Random r = new Random(Şystem.curcenttieMillis()); int alength = CiextInt(10) + 90; int blength = aoextInt(10) + 10; while(alength % blength != 0) alengtb++; a = new int[alenstb]; b = new int[blengtb]; for(int i = 0; i < audength;="" i++)="" a[i]="aextInt(10);" erintterwacd(a);="" for="" (int="" index="0;" index="">< andength;="" ){="" for(int="" į="0;" i="">< bedensth;="" i++)="" b[i]="a[indexti];" brintkaskward(b);="" index="" +="bulength;" }="" }="" 9;="" 2;="" making="" alength="" divisible="" by="" blength="" private="" static="" void="" printbaskward(int[]="" x)="" {="" for(int="" i="Xength" sxsten.qut.rcint(x[¿]="" +="" ".="" susten="" qut.brintla();="" }="" 1;="" i="">= 0; j--) "); - private static void printforward(int[] x) { for(int i = 0; i < xulength; i++) sustem.qut rcint(x[i] + sustem.auturrintla(); } } ", "); answer: page 1 of 1 204 words e english (united states) e3 focus 107% xulength;="" i++)="" sustem.qut="" rcint(x[i]="" +="" sustem.auturrintla();="" }="" }="" ",="" ");="" answer:="" page="" 1="" of="" 1="" 204="" words="" e="" english="" (united="" states)="" e3="" focus="">
Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here