title: Printing uptime and idealtime in linux using /proc
body: <p>I am new to Linux. I made this program for printing uptime and ideal time of my Linux machine. But everytime i run this, it shows idealtime = 0. Can i ever get idealtime=0 ?</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  
  int main() 
  
  
  {
  
  int a,b;
  FILE *fp; 
  fp=fopen("/proc/uptime","r");
  fscanf(fp,"%d%d",&amp;a,&amp;b);
  printf("\n\nUptime =%d \nIdealtime =%d",a,b);
  fclose(fp);
  
  return 0;
  }
  </code></pre>