title: How to call a C function that simply prints out a statement depending on the parameter
body: <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;math.h&gt;
  
  int guessGame(int guessed_num){
      int counter = 0;
      int random_num = 0;
  
   while(1)
      {
          counter++;
          if (guessed_num == random_num)
          {
              printf("Correct! That's the number.\n", counter);
              break;
          }
  
          if (guessed_num &lt; random_num)
              printf("Too low. Guess again.\n");
  
          if (guessed_num &gt; random_num)
              printf("Too high. Guess again.\n");
  
      }
  
  }
  
  int main(){
  
  int guessed_num = 0;
  
  
  srand(time(NULL));
  int random_num = rand() % 50 + 1;
  
  printf("I have a number between 1-50.\n");
  printf("Can you guess what it is?\n");
  printf("Enter your initial guess.\n");
  
          scanf("%d", &amp;guessed_num);
          printf("%d\n" ,guessGame(guessed_num));
  
  
  return 0;
  }
  </code></pre>
  
  <p>So i have to make a guessing game where the user has to correctly guess a randomly created integer. The thing is, I have to use a function to run the actual guessing game. I'm stuck because I don't know how to properly call my function. I know for a fact my printf statement in my main function is not the proper way to do it.</p>