Question: NASM code must: 1 . Read number as input as the number of elements in array using the C function scanf ( ) . If
NASM code must:
Read number as input as the number of elements in array using the C function
scanf If the number less than or equal to you must use as the array size.
Read seed as input to use as the seed to the C function rand using the C function
scanf If the number zero is given as input, then you must use as the seed
value.
a Seed the rand with the given seed value. Check man rand
Read a value to apply to rand values as a modulo value like the C operator If
the number is less than or equal to given as input, you must use the value as the
modulo value.
Allocate an array of byte values, based on array size from step using the C
function malloc
Loop through array and assign random numbers into array, modulo the input value
from step C pseudocode for this might look like:
int array; bytes per index
array mallocarraysize ;
forint i ; i arraysize; i
arrayi rand modvalue;
Loop through the array from index to index arraysize and print the
value from each index. This must be a separate loop from step
No memory leaks.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
