# Starter file for ex1.asm .data #... .text main: #... #... #----------------------------------------------------------------# # Write code here to do exactly what main does in the C program. # # Please follow these guidelines: # # Use syscall 5 each time to read an integer (scanf("%d", ...)) # Then call NchooseK to compute the function # Then use syscall 1 to print the result # Put all of the above inside a loop #----------------------------------------------------------------# end: ori $v0, $0, 10 # system call 10 for exit syscall # we are out of here. NchooseK: # PLEASE DO NOT CHANGE THE NAME "NchooseK" #----------------------------------------------------------------# # $a0 has the number n, $a1 has k, from which to compute n choose k # # Write code here to implement the function you wrote in C. # Your implementation MUST be recursive; an iterative # implementation is not acceptable. # # $v0 should have the NchooseK result to be returned to main. #----------------------------------------------------------------# #... #... jr $ra