Hello, It seems like you converted our program in the article Interfacing HC-SR04 with PIC Microcontroller to CCS C.
In that tutorial I used prescaler : 2, so you should use :
and you should change a-4 to a in printf().
Please check the above program after making these changes and let me know whether it works or not. If it works, I can include it too in that article such that it will help others too.