6You may improve the program by checking whether ri = 0  .