title: C program to print up-time in hours,minutes and seconds.
body: <p>I made this program to print up time in hours,minutes and seconds </p>
  
  <pre><code>#include&lt;stdio.h&gt;
  
  int main()
  
  {
  
  float a, b,x,mina,minb,hrsa,hrsb;
  float seca,secb;
  FILE *fp = fopen("/proc/uptime", "r");
  fscanf(fp, "%f %f", &amp;a, &amp;b);
  
  seca=(a)%60;
  mina=seca/60;
  hrsa=mina/60;
  
  secb=(b)%60;
  minb=secb/60;
  hrsb=minb/60;
  
  printf("Uptime=%f hrs %f min %f sec",hrsa,mina,seca);
  
  printf("Idealtime =%f hrs %f min %f sec",hrsb,minb,secb);
  
  return 0;
  }
  </code></pre>
  
  <p>here i am getting an error "invalid operands to binary" in lines 12 and 16. </p>