Guessing game in C, cannot get the number of tries to work, variable is "counter" : <p>Not too sure how to make the counter variable work to count how many tries it takes to guess the number right. Ive tried putting "counter++;" in each if statement but that doesn't do anything. This is my first code that I've written by myself so don't drag it too hard please &lt;3</p>

<pre><code>int main()
int counter
{
    int num , guess;
    counter = 0;
    srand(time(0));
    num = rand() % 200 + 1;

    printf ( "Guessing game, guess the number between 1 and 200" );

    do {
        scanf ( "%d" , &amp;guess);
        if ( guess &gt; num ){
        printf ( "Too high" );
    }

        if ( guess &lt; num ){
        printf ( "Too low" );
    }

        if ( guess == num ){
        counter++;
        printf ( "Your guess is correct!, it took you %d tries" , counter );
        }


    }while (guess != num);

return 0;

}
</code></pre>
