Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Dasproc C - 2019
- William Handi Wijaya
- 0087
- Menghitung perubahan pada cobalt
- */
- #include <stdio.h>
- #include <math.h>
- #define HALF_LIFE 5.272
- int main()
- {
- int i; //loop variable
- double amount; // input - initial amount of cobalt
- //get the initial amount
- printf("\nEnter the initial amount of Cobalt - ");
- scanf("%lf", &amount);
- //printing the results
- printf("\nYear %8c Amount Remains", ' ');
- //printing the each year remains
- for (i = 1; i <= 5; i++)
- {
- amount -= (amount * exp(-0.0693 * (i / HALF_LIFE)));
- printf("\n %d %10c %.4f g", i, ' ', amount);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment