/*To Calculate the half life of a radio active substance*/
#include<math.h>
#include<stdio.h>
int main()
{
float t, lambda, N, N_0, T;
printf("The value of present time, t: ");
scanf("%f", &t);
printf("The # of radioactive atoms in that time: ");
scanf("%f", &N);
printf("The initial Number of radioactive atoms: ");
scanf("%f", &N_0);
lambda=(1/t)*log(N_0/N);
T=0.693/lambda;
printf("\nThe half-life of the radioactive atom, T: %f\n",T);
return(0);
}
#include<math.h>
#include<stdio.h>
int main()
{
float t, lambda, N, N_0, T;
printf("The value of present time, t: ");
scanf("%f", &t);
printf("The # of radioactive atoms in that time: ");
scanf("%f", &N);
printf("The initial Number of radioactive atoms: ");
scanf("%f", &N_0);
lambda=(1/t)*log(N_0/N);
T=0.693/lambda;
printf("\nThe half-life of the radioactive atom, T: %f\n",T);
return(0);
}
Comments
Post a Comment