Finally got it.
changing the img src to "/yiiecom/images/ does the job
<?php echo CHtml::link('<img src="/yiiecom/images/' . $data->id . '.jpg">', array('view', 'id'=>$data->id)); ?>
Why I didn't get it before inspite of it having been explained by you
<"Okay, good. I assume, then, that the URL you're using is http://localhost/yiiecom. If so, then the values for the img src attributes have to be /yiiecom/images. The default value of /images means the browser will look for the images in the "images" folder in the web root directory, C:\xampp\htdocs\images, in your case. Make that change and you should be good.">
Thanks a lot Larry for your valuable help.