Page 1 of 1

Try to convert the following C code to Assembly #include int main(void) { int array[] = {10, 60, 20, 33, 72, 8

Posted: Fri May 20, 2022 1:14 pm
by answerhappygod
Try to convert the following C code to Assembly
#include <stdio.h> int main(void)
{
int array[] = {10, 60, 20, 33, 72, 86, 45, 65, 72, 18};
int sample = 50;
int ArraySize = sizeof(array) / sizeof(sample);
int index = 0;
int sum = 0;
while ( index < ArraySize )
{
if( array[index] > sample )
{
sum += array[index];
}
}
index++;
printf("Sum = %d\n", sum);
}