DIM X, A, B, C AS INTEGER INPUT X A = 0: B = 10 WHILE X > 0 C = X MOD 10 A = A + C IF C < B THEN B = C X = X \ 10 WEND PRINT A PRINT B