Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Convert this C program to Risc V assembly code, then test to see if it works. #include int main() { int arr[] = { 2,
Convert this C program to Risc V assembly code, then test to see if it works.
#include
int main()
{
int arr[] = { 2, 6, 8, -4, -5, 5, -11 };
int n = 7;
int pos_count = 0;
int neg_count = 0;
int i;
for (i = 0; i
if (arr[i] > 0)
pos_count+= arr[i];
else
neg_count += arr[i];
}
printf("pos_count = %d", pos_count);
printf("neg_count = %d", neg_count);
return 0;
}
\#include int main() \{ int arr[]={2,6,8,4,5,5,11[]}; int n=7; int pos_count =0; int neg_count =0; int i; for (i =0;i
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started