title: MIPS - Prints the input next to output
body: <p>I'm learning MI trying to write a factorial program in MIPS Assembly code for which</p>
  <pre><code>3! = 6 (my output shows it 36)(input next to output)
  4! = 24(my output shows it as 424)
  </code></pre>
  <p>Here is my code. What should I do to get rid of printing the input?</p>
  <pre><code>         .data
  num:     .asciiz &quot;\nPlease enter a number: &quot;
  num2:     .asciiz&quot;\nPlease give your second number : &quot;
  respon:   .asciiz &quot;\nThe factorial of the entered number is: &quot;
  nl:       .asciiz&quot;\n&quot;
          .text
  
  fact:
          beqz $a0,return1
  
          li $v0, 1
          li $t0, 1
  
  fact_loop:
          bgt $t0, $a0, end_fact_loop
          mul $v0, $v0, $t0
          addi $t0, $t0, 1
  
          j fact_loop
  
  end_fact_loop:
          jr $ra
  
  return1:
          li $v0, 1
          jr $ra
  
  main:   
          li $v0, 4
          la $a0, num
          syscall
  
          li $v0, 5
          syscall
          move $t0, $v0
  
          li $v0, 4
          la $a0, respon
          syscall
  
          li $v0, 1
          move $a0, $t0
          syscall
  
          jal fact
          move $t0, $v0
  
          li $v0, 1
          move $a0, $t0
          syscall
  
          li $v0, 4
          la $a0, nl
          syscall
          
   ################################
          li $v0, 4
          la $a0, num2
          syscall
  
          li $v0, 5
          syscall
          move $t0, $v0
  
          li $v0, 4
          la $a0, respon
          syscall
  
          li $v0, 1
          move $a0, $t0
          syscall
          jal fact
  
          move $t0,$v0
  
          li $v0, 1
          move $a0, $t0
          syscall
  
          li $v0, 10
          syscall
  </code></pre>