c to mips assembly converter
ngeElements void main() { int arraysize = 11; int numbers[arraysize]; int howMany, theNthSmallest, index, i; printf("Specify how many times to repeat:\n"); scanf("%d", &howMany); printf("Enter an integer for the Nth smallest:\n"); //read an integer from a user input scanf("%d", &index); //if the index is not within the range, //and if it is smaller, set it to 1, if it is larger, //set it to the size of the array. if (index < 1) { index = 1; } else if (index > arraysize) { index = arraysize; } i=0; while (i < howMany) { theNthSmallest = findTheNthSmallest(numbers, arraysize, index); printf("The %d(-th) smallest number is %d\n\n", index, theNthSmallest); i++; } }
c to mips assembly converter
for (i=1; i<=N; i++) { a[i] = c[i]*16; // Do not use the mul inst }
c to mips assembly converter
int v1=5,v2=2,v3=9,v4=1; int sum, sub; sum=v1+v2; sub=v3-v4; if(sum>sub){ printf("%d",sum); } else{ printf("%d",sub); }