Visitar URL original
GitHub - alanwatson/first-coding · GitHub
Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 

Repository files navigation

first-coding

Program Description: Calculate how long Carbon-14 decay has been on-going (in years) with the given remaining amount of the radio active Carbon-14 material.

#include<math.h> #include<stdio.h>

int main(void) { float target; float Prem; //percentage of C-14 remaining float agsam; // age of sample float rd; //rate of decay

printf("\nEnter the percentage of carbon-14 remaining: "); scanf("%f", &target);

Prem = target / 100; rd = 0.00012097;

agsam = -(1 / rd) * log(Prem); printf("\nPercentage of C-14 remaining: %.2f", target);

printf("\nThe age of the sample: %.5f years\n", agsam);

return(0); }

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors