Implementation of ls - i command

It is possible for me to obtain the Inode of the path name using
ls -i <pathname> command

Can anyone tell me how its implemented...

I'm not sure what you want - my guess is:
you want the inode of a directory file?

ls -id <pathname>

Yes. May be the C code implementation of ls command so that i can understand what happens in background..
Thanks for your reply

See 'man 3 opendir' and 'man 3 readdir'. ls doesn't even need to call stat on the filenames, readdir gives inodes directly.