Last active
June 10, 2017 10:54
-
-
Save KeitetsuWorks/6926102095fe44795c58a5ed24428a3f to your computer and use it in GitHub Desktop.
q14175234339
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main(void) | |
{ | |
int v; // 計算対象値は整数型と浮動小数点型 | |
float w; | |
float wa,seki; // 計算結果は浮動小数点型変数に格納 | |
v = 10; // 計算対象値を代入 | |
w = 25.5; | |
wa = v + w; // 浮動小数点型に型変換されて格納される | |
seki = v * w; | |
printf("v: %d, w: %f\n", v, w); | |
printf("計算結果\n"); | |
printf("v + w: %5.1f, v * w: %5.1f\n", wa, seki); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment