title: Calling another function from printf?
body: <p>I am doing a simple challenge from a  book on C/Objective-C where I have to write a program that computes and displays the square of an integer, while also putting the numbers in quotation marks.</p>
  <p>I made a program that works successfully but I have two questions about it.
  Firstly having had the the idea of cutting back on the amount of code in mind, to practice being efficient and concise in my code, I called my <code>squareOfInteger</code> function from my <code>printf</code> statement. Is this advisable though? It worked but I'm worried this might be bad practice?</p>
  <p>The other thing nagging at me is whether or not I need to reiterate the type as being an <code>int</code> inside the parameter of my function before my variable <code>number</code>, or whether it is enough to declare the result as being of type <code>int</code>, and leaving out type in the parameter, which I have done below.</p>
  <p>Here is my code:</p>
  <pre><code>#include &lt;stdio.h&gt;
  
  int squareOfInteger(number)
  {
      int square = number * number;
      return square;
  }
  
  int main(int argc, const char * argv[]) {
      int myNumber = 5;
      printf(&quot;\&quot;%d\&quot; squared is \&quot;%d\&quot;.\n&quot;, myNumber, squareOfInteger(myNumber));
      return 0;
  }
  </code></pre>
  <p>I would greatly appreciate your help.</p>