Question: Convert the C code into MIPS Assembly language, the code is about testing a number is prime or not prime, here's the code: #include int
Convert the C code into MIPS Assembly language, the code is about testing a number is prime or not prime, here's the code:
#include
int primeint n
if n
return ;
for int i ; ii n; i
if ni
return ;
return ;
int main
int n;
printfPlease input a number: ;
scanfd &n;
if primen
printfIts a prime
;
else
printfIts not a prime
;
return ;
Please run it on ubuntulinux and attached the screenshot of the output.
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
