Ok, since I'm so kind, here you go:
Code:
#include <stdio.h>
int main()
{
// Declare the variables.
int l1,ll,lox;
char buf[10];
// Initalize variables.
lox = 1;
ll = lox;
printf("Enter a number:");
fflush(stdout);
scanf("%d", &l1); // Read the number.
ll--;
while(lox < l1) lox = ((lox << 2) + (lox)) << 1; // Figure out the multiplier.
while(lox) { ll += l1 % 10; l1 /= 10; lox /= 10; }; // Sum it up.
sprintf(buf, "%%d"); // Make a format string.
printf(buf, ll); // Display the result.
return 0;
}
--
Mats