Answer to Question while-2

  int p = 1;
  int i = 1;
  while(i <= n)
  {
    p *= x;
    i++;
  }