fork download
  1. program C14_date
  2. implicit none
  3. real,parameter::lamda=0.00012097
  4. real::age,percent,ratio
  5. print *,'Enter the percentage of carbon 14 remaining:'
  6. read *,percent
  7. print *,'The remaining carbon14=',percent,'%.'
  8. ratio=percent/100
  9. age=(-1.0/lamda)*log(ratio)
  10. print *,'The age of the sample is',age,'yeqrs.'
  11. end program
Success #stdin #stdout 0.01s 5320KB
stdin
50
stdout
 Enter the percentage of carbon 14 remaining:
 The remaining carbon14=   50.0000000     %.
 The age of the sample is   5729.91016     yeqrs.