I know that for older versions of .NET, you can determine if a given version is installed by following
https://support.microsoft.com/en-us/kb/318785
It doesn't need a installation process.
I have pinned "VSCore" on my taskbar (win10), so open it, and open a task manager choose "Visual Studio Core" process expand left arrow and over any of them child process right button over it and click in "Open File Location" menu.
If you don't remember where is installed search "Code.exe" file in all your hard drives.
After all the other answers, this might prove useful.
Open your application in Visual Studio. In Solutions Explorer, right click your project. Click Properties. Click Application. Under "Target Framework" click the dropdown button and there you are, all of the installed frameworks.
BTW - you may now choose which framework you want.
Look in C:\Program Files\dotnet\shared\Microsoft.NETCore.App
to see which versions of the runtime have directories there. Source.
A lot of the answers here confuse the SDK with the Runtime, which are different.
You can check if dotnet.exe is available:
where dotnet
You can then check the version:
dotnet --version
UPDATE: There is now a better way of doing this, which is well explained in many other answers:
dotnet --info
Run this command
dotnet --list-sdks
(1) If you are on the Window system.
Open the command prompt.
dotnet --version
(2) Run the below command If you are on Linux system.
dotnet --version
dotnet --info