C program compilation without DUT

Hi
Please clarify me…
Can I able to test my C programs in platform IO and see the result in platform IO Terminal , without connecting MCU.?

If yes , pls suggest how to do it.

Depending on the MCU, you can emulate it. For many ARM MCUs: use Renode. That’s also built-in. For AVRs: Use simavr. That’s again built-in.

You can also use a fake Arduino.h library (or this one) to attempt to compile the program for your native Desktop machine, as done in official unit test examples. As soon as your code wants to access hardware registers or features directly though, this will fail of course. It only mocks the high-level calls like digitalWrite() etc.