Anil Katte
  1. Press WINDOWS+R
  2. type %appdata%
  3. Click on "Ansys" folder
  4. Click on v231 on in your case might be different
  5. Search for uninstall icon in it and delete it
  6. And then try to install ansys again


these steps really works my problem was solved thank you