Issue: Tried to run a C program using gcc in the VS code. After compilation the .\a.exe gets deleted
This was caused by the McAfee Security scan that was detecting the executable file as not safe. It was deleting the .\a.exe file immediately.
Useful: link
Solution: Exclude your project folder or the location where a.exe is generated.
Click Settings (Right top corner)
Click Real-Time scan
Click Excluded Files
Click Add files Browse to, and select files, which you want to be excluded from the McAfees virus scan. In this way, you can tell your virus scanner that these are known safe files not a trojan or malware
(or)
After Step 4. Click Turn off > Select the duration. This will completely stop the Real time scan for certain duration.