Menu

[Solved]Please Translate Following C Code Arm Assembly Include Int Main Creating Integer Array Int Q37128130

PLEASE TRANSLATE THE FOLLOWING C CODE INTO ARMASSEMBLY

#include <stdio.h>
int main ()
{
//creating integer array
int age[] = {100, 40, 5, -1, 19};
const int size = 5;

//western cultural generation
int lostGeneration = 0;
int greatestGeneration = 0;
int babyBoomerGeneration = 0;
int generationX = 0;
int generationY = 0;
int generationZ = 0;
int notApplicable = 0;

int i = 0;

//Counts how many are in certain generations
for(i=0; i < size; i++){

if (age[i] >= 102 && age [i] <=127){
lostGeneration++;
}
else if (age[i] >= 93 && age [i] <= 101){
greatestGeneration++;
}
else if (age[i] >= 53 && age [i] <= 71){
babyBoomerGeneration++;
}
else if (age[i] >= 38 && age [i] <= 52){
generationX++;
}
else if (age[i] >= 22 && age [i] <= 36){
generationY++;
}
else if (age[i] >= 7 && age [i] <= 21){
generationZ++;
}
else{
notApplicable++;
}
}

//prints out number of people in each generation
printf(“Lost Generation: %dn”, lostGeneration);
printf(“Greatest Generation: %dn”, greatestGeneration);
printf(“Baby Boomer Generation: %dn”, babyBoomerGeneration);
printf(“Generation X: %dn”, generationX);
printf(“Generation Y: %dn”, generationY);
printf(“Generation Z: %dn”, generationZ);
printf(“Not Applicable: %dn”, notApplicable);
return 0;
}

Expert Answer


Answer to PLEASE TRANSLATE THE FOLLOWING C CODE INTO ARM ASSEMBLY #include int main () { //creating integer array int age[] = {100… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *