How to print id of user whose profile I visit rather than id of  logged in user? I would like to print the id of the user on his profile page? How can I do it in Drupal 7. So far I could only print logged in user id..Any advice appreciated.
The function menu_get_object() allows you to get a user/node/.. object based of the current request URL.

To get the account object, you can do this:

if ($account = menu_get_object('user')) {
  print $account-&gt;uid;
}