C++ to BCD conversion help

Hey everyone im working on programming an attiny2313 with AVR studios, im looking to convert this code from C++ to BCD. Was wondering if anyone knew either a way to convert it or if anyone could post the conversion. If anyone could help that would be great.

int _tmain(int argc, _TCHAR* argv[])
{
char tmpc = 75;
char temp;
char tens;


temp = tmpc;
tens = 0;
while (temp > 10)
{
tens ++;
temp = temp -10;
}

printf("\n Tmpc %d, tens = %d, ones = %d",tmpc,tens,temp);
return 0;
}

Topic archived. No new replies allowed.