title: How to print the current user and system name in Unix?
body: <p>Please i am looking forward to learn how to print the current logged-in user and system name in Unix. </p>
  
  <pre><code>#include &lt;unistd.h&gt;
  #include &lt;fcntl.h&gt;
  
  using namespace std;
  
  int main(int argc, char **argv)   
  {      
       //Print the current logged-in user / username.   
       //Print the name of the system / computer name.
  
       return 0;
  }
  </code></pre>
  
  <p>I would be grateful if you can provide a line of code or two as demonstration. Thanks</p>