I want to extend C: drive in my Windows 7 PC which is the primary partition. I converted its adjacent D: drive into primary partition which was initially a logical partition. But the problem is that I am unable to extend C: by merging both C: and D:, because in windows disk management when I right-click C:, the extend volume feature is greyed out. Why is it happening and what should I do? I am also giving an image of my partitions herewith.
You can't (directly) merge 2 partitions. The "Extend Volume" option is greyed out because it has no available space adjacent to the partition, making C bigger would overlap with D, which is a full fledged partition (it is just empty, but that does not matter, that space is reserved for it anyways).
The solution is to delete the volume D, and apply changes, so that region of the disk becomes unallocated space instead.
In any case, there are some changes that you cannot do to a partition when booting from it. The easiest solution for this problem is to just use a live SO that does not need to make use of the partition you want to modify, like the open source utility gparted: https://gparted.org/ (you can burn a bootable CD/USB to use this utility)