Double型の変数を使用する場合、『%lf』を用いて
/* "struct Car" Declaration */
struct Car {
int num;
double gas;
};
int main(void) {
値を取得する。
/* "struct Car" Declaration */
struct Car {
int num;
double gas;
};
int main(void) {
struct Car car1;
car1.num = 1234;
car1.gas = 25.5;
printf("the car number is %d.: the amount of gas is %lf.\n", car1.num, car1.gas);
return 0;
}
car1.num = 1234;
car1.gas = 25.5;
printf("the car number is %d.: the amount of gas is %lf.\n", car1.num, car1.gas);
return 0;
}
No comments:
Post a Comment