The progarmming language is risc-v, sorry that i will dislike if not written in risc-v and copied from another answer
Please also show the screenshot of the 3 test cases
Write a function square inRISC-V that takes in an integer n ad returns its square. If n is not positive, then the function returns 0. Save your program as task1.s.
Test cases: (1) n = 3, output: 9 (2) n = 12, output: 144 (3) n = -1, output: 0
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here