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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

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

Post 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);
}
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply