Get the files, design your code, and type it in before the lab period.
## Question:
## "numbers" is an array of five words.
## Calculate the sum of all elements in "numbers"
## whose value is less than 1000.
##
The file minmax.c is set up with data and
int main () { /* declare variables here */ int mymin, mymax; /* use these */Above the ----- start cut ------
printf ("The minumum = %d and the %s = %d\n", mymin,"maximum", mymax); return 0; /* 0 tells operating system "Normal termination" */ } /* end main */It is important to use the defined SIZE, not 10, in your loop. since this will vary from case to case.
# define INT32_MAX (2147483647) # define INT32_MIN (-2147483647-1)You can also write 0x7fffffff and 0x80000000 for the largest and smallest integers, in C as well as in assembly.
After it works, you will be able to test it with mipsmark, and submit with
submit cs216, just like
for .a files.
If you have trouble with mipsmark, check the validity of your calculations.
cat
mark.log # will
show you what happened
showcase loopc.a 2 # will give you a
file for case 2 (loopc_2.a) which you can use for testing, it will
also have the correct answer for that case.
(C programs will give you minmax_1.a, rename to .c)
Then see common reasons mipsmark may fail.