What is wrong in this code????......why it is showing runtime error while it is running perfectly on ecilipse.

import java.util.Scanner;

class Main{

 public static void main(String args[])
  {
    int t,n;
   Scanner sc = new Scanner(System.in);
    t=sc.nextInt();
    while(t>0)
    {
      n=sc.nextInt();
      if(n>-20&&n<20)
       {
         if(n<10)
          {
            System.out.println("What an obedient servant you are!");
          }
          else
          {
            System.out.println("-1");
          }
       }
    }
    sc.close();
  }
}

Always include the problem link. Your program will never terminate, as the while condition will always be ‘true’ (because ‘t’ is never changed). You need to decrement ‘t’ by 1.

Corrected Solution: https://www.codechef.com/viewsolution/18966439