digisum.f90

I suggest you either typed  this as it appears into the compiler, or as an easier way, just copy and paste it!

Note: I do not claim the program will 100% work, but I give it my best. If it doesn't, try tweaking it yourself, or email me about it, and I'll modify and post the improved version later. Good luck!

 

PROGRAM digisum
IMPLICIT NONE

INTEGER :: in_counter
INTEGER, DIMENSION (1:100) :: digit_sum
INTEGER :: in_counter2, sum

!The part where every single element in the array (digit_sum) is given a value.
DO WHILE (in_counter2<=100)
digit_sum(in_counter2)=in_counter2
in_counter2=in_counter2+1
END DO

PRINT*, "Welcome to ADCY program to add up 100 digits in an array."
PRINT*, "These are the numbers:", digit_sum
PRINT*

!The actual counting part.
DO WHILE (in_counter<=100)
sum=sum+digit_sum(in_counter)
in_counter=in_counter+1
END DO

PRINT*
PRINT*, "Is this the sum that your looking for?", sum
PRINT*
PRINT*, "Thank you for using this ADCY program."
PRINT*, "Future releases will be more...FANTASTIC!"

END PROGRAM digisum