%lu is correct, while %ul is incorrect. A printf format specifier follows the form %[flags][width][.precision][length]specifier. u is a specifier meaning "unsigned decimal integer". l is a length modifier meaning "long". The length modifier should go before the conversion specifier, which means %lu is correct. More @Wikipedia
Hover over any link to get a description of the article. Please note that search keywords are sometimes hidden within the full article and don't appear in the description or title.