title: C programming functions
body: <p>I'm very new to programming and recently I came across the function topic. As I wanted to experiment out my knowledge I wrote this very basic code</p>
  
  <p>My aim is to make the separate read function, calculate function and print function and to call the three function in the main... However, this code doesn't show any error but the output that it gives is just the garbage value, how can I make it to really work?</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  void read(int hrs,int pR);
  int calc(int hrs, int pR);
  void print(int res);
  
  int main()
  {
      int hours, payRate;
      read(hours,payRate);
      calc(hours, payRate);
      int c = calc;
      print(c);
  }
  
  void read(int hrs,int pR)
  {
      printf("enter hours and pay rate");
      scanf("%d%d", &amp;hrs, &amp;pR);
  }
  
  int calc(int hrs, int pR)
  {
      int grossPay = hrs * pR;
  
      return grossPay;
  }
  
  void print(int res)
  {
      printf("The grossPay is %d", res );
  }
  </code></pre>