oiipreciso fazer uma função troco em linguagem fortran 95 que se refere a trocoem notas de 50,20,10,5,1 e 0.50,0.25,0.10,0.05,0.01so que ele ta dando um erro enão consigo arrumar alguem pode me ajudar
real function troco(volta)integer, dimension(12) :: vetortrocoreal :: voltainteger, dimension(:) :: nota(7), cent(5)integer :: i, j, qn, vlr
nota=(/100,50,20,10,5,2,1/)cent=(/50,25,10,5,1/)
vlr = int(volta)i = 1do while ( vlr /= 0 )qn = vlr / nota(i) !Quantidade de notasif ( qn /= 0 )thenvetortroco(i) = qnvlr = mod(vlr,nota(i))elsevetortroco(i) = 0
end ifi = i + 1end do
vlr = fraction( volta - int(volta)*100)i = 1j = 8do while ( vlr /= 0 )qn = vlr / cent(i) !Quantidade de centif ( qn /= 0)thenvetortroco(j) = qnvlr = mod(vlr,cent(i))elsevetortroco(j) = 0end ifi = i + 1j = j + 1end do
end function troco