Hi All. Sorry for the delay as I was busy getting things sorted.
Sorry I should have mentioned my car model in the first post itself, my bad. Its a nissan n16 and as Rumesh88 and others mentioned it was the compressor stuck.
Replaced the compressor and did a AC service and ran like 30kms and so far the engine didn't stop and seems its sorted.
I am a bit worried as early today morning when i started the check engine came up in the 1st KM the car wasnt running that smooth and after i stopped and started the engine the check engine was off and everything was normal.
lets see if the same thing happens tomorrow morning, if so could it be the pressure of petrol pump?
btw thanks all for the comments, was very useful appreciate it