添加platinum.c
This commit is contained in:
parent
b05b7492cc
commit
6dcbcac092
16
chapter3/platinum.c
Normal file
16
chapter3/platinum.c
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main(void){
|
||||||
|
float weight;
|
||||||
|
float value;
|
||||||
|
printf("Are you worth your weight in platinum?\n");
|
||||||
|
printf("Let's check is out.\n");
|
||||||
|
printf("please enter your weight in pounds:");
|
||||||
|
scanf("%f", &weight);
|
||||||
|
value = 1700.0 * weight * 14.5833;
|
||||||
|
printf("Your weight in platinum is worth $%.2f.\n", value);
|
||||||
|
printf("You are easily worth that! If platinum prices drop,\n");
|
||||||
|
printf("eat more to maintain your value.\n");
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user