Calculate maximum possible helpful flags for n days This program is supposed to calculate the mathemathical maximum of helpful flags you can have on the nth day, starting with 0 helpful flags, using the StackExchange system of gaining more possible flags, meaning every 10 helpful flags you gain one possible one, immediately.

#include &lt;stdio.h&gt;

// &lt;summary&gt;
// Small C program to simulate how many helpful flags someone could have raised on both comments and posts
// Assumptions:
// - Flags would be immediately marked helpful or near immediately
// - Every 10 flags, you get one extra flag per day, up to 100 total flags.
// - No declined flags
// @Author: Magisch - http://stackoverflow.com/users/5389107/magisch
// @License: CC0
// &lt;/summary&gt;

int main(void) {
    int nDays = 0; // Days to simulate for
    int totalFlags = 0; 
    int dailyFlags = 10;
    int bonusCountdown = 0;
    int totalFlagsBeforeCalc = 0;

    printf("Enter the amount of days you want to simulate flags for:\n");
    scanf("%d ", &amp;nDays);

    printf("Computing maximum helpful comment flags and post flags for %d days.\n",nDays);

    for (int i = 0; i &lt; nDays; i++) {
        totalFlags += dailyFlags;
        bonusCountdown += (totalFlags - totalFlagsBeforeCalc);
        totalFlagsBeforeCalc = totalFlags;
        while (bonusCountdown &gt;= 10 &amp;&amp; dailyFlags &lt; 100) {
            dailyFlags++;
            totalFlags++;
            bonusCountdown -= 10;
        }
        printf("Day %d : total helpful flags: %d | daily available flags: %d\n", i+1, 2*totalFlags, dailyFlags);
    }
    printf("Simulated %d days. Total helpful flags: %d",nDays,2*totalFlags);
    return 0;
}


Example of the Results for n = 52 : http://pastebin.com/TbjRPjBn

I'm a beginner still in coding (second year apprentice), so please don't hold back on any critique.
You ought to check scanf return value and also that the input value is not negative. ++i please.