Thats exactly what I wanted, thanks :)
I think the c would be almost exactly the same:
#include <stdio.h>
int main (int argc, const char * argv[])
{
int num = 33153;
int printNum = num;
int myNumberToCount = 3;
int count = 0;
while (num > 0)
{
int a = num % 10;
num /=10;
if (...