PROGRAM DECIMAL2

IMPLICIT NONE

INTEGER  :: I,B,K,D
REAL(8)     :: X,Y

PRINT *, 'DOSE TON DEKADIKO ARITHMO, THN NEA BASH KAI TO MHKOS TOY ARITHMOU'
READ  *, X,B,K

I = -1
Y =  X

DO WHILE (I.LE.K) 

I =  I +1

IF (I.NE.0) Y =  (Y*B) - D

IF (Y.NE.0.) THEN 
D =  INT(Y*B)
ELSE 
STOP
END IF


PRINT *,I, D, Y

ENDDO

END PROGRAM DECIMAL2

