Compatible Versions of Visual Studio, CUDA, and BitHub Samples for Windows 10

I have installed CUDA 11.6. Can CUDA 11.6 and CUDA 11.8 be used by switching? I installed CUDA 11.8 once, but GitHub applications using CUDA 11.8 did not work,