Minus comments. From here almost 50 years ago. Made a few modifications so it would work with GFortran. It works!
Here’s the code…
CNT=1.
ESUM=2.
FACT=1.
10 CNT=CNT+1.
FACT=FACT*CNT
ESUM=ESUM+1./FACT
IF (ESUM .LT. 2.7182)GO TO 10
ESUM=FLOAT(INT(ESUM*10000.))/10000.
WRITE(6,11)ESUM
11 FORMAT('1','e = ',F7.4)
12 WRITE(*,fmt="(a)", advance="no")'Enter degrees (0 to end) '
READ(*,*,END=1000)DEG
IF(DEG .EQ. 0.)GOTO 1000
15 FORMAT(F5.2)
X=DEG/(180./3.141592)
FACTUP=4.
SUM=X
FACT=6.
PWR=3.
ICNT=1
20 XSIN=X**PWR/FACT
ICHECK=ICNT/2
IF(ICHECK*2 .EQ. ICNT)GO TO 30
SUM=SUM-XSIN
25 GO TO 35
30 SUM=SUM+XSIN
35 PWR=PWR+2
FACT=FACT*FACTUP*(FACTUP+1.)
ICNT=ICNT+1
FACTUP=FACTUP+2.
IF(ICNT .LE. 11) GO TO 20
SUM=FLOAT(INT(SUM*10000.))/10000.
WRITE(6,950)DEG,SUM
950 FORMAT('','THE SINE OF ',F7.2,' DEGREES IS ',F7.4)
GO TO 12
1000 WRITE(6,1025)
1025 FORMAT('','JOB COMPLETED')
STOP
END
GFortran program output
bill@bill-MS-7B79:~/MyStuff/Fortran/test$ ./a.out
1e = 2.7182
Enter degrees (0 to end) 40
THE SINE OF 40.00 DEGREES IS 0.6427
Enter degrees (0 to end) 0
JOB COMPLETED
bill@bill-MS-7B79:~/MyStuff/Fortran/test$
Python program output
bill@bill-MS-7B79:~$ python
Python 3.10.12 (main, Jan 8 2026, 06:52:19) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import math
>>> print(math.sin(math.radians(40)))
0.6427876096865393
>>> exit()
bill@bill-MS-7B79:~$