“C ke MIPS Assembly Converter” Kode Jawaban

C ke 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++;
    }
  }
Yaci Zhu

C ke 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);
	}
Aman Saeed

Jawaban yang mirip dengan “C ke MIPS Assembly Converter”

Pertanyaan yang mirip dengan “C ke MIPS Assembly Converter”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya