Would someone be so kind as to tell me the codes used in the addition of decimal numbers? Like, the variables and such.. o_O.. please? I've asked a few people this question before, and they give me this kind of coding:
float a;
float b;
a = 5.5
b = 6.3
printf("%f\n", (a + b));
But I need the program to randomly choose decimal numbers and add them together (so I can't define the decimals beforehand). The numbers have to be between 1 and 100. Any ideas? Thanks. :ninja:
Question
Fullest_Empty
Would someone be so kind as to tell me the codes used in the addition of decimal numbers? Like, the variables and such.. o_O.. please? I've asked a few people this question before, and they give me this kind of coding:
float a;
float b;
a = 5.5
b = 6.3
printf("%f\n", (a + b));
But I need the program to randomly choose decimal numbers and add them together (so I can't define the decimals beforehand). The numbers have to be between 1 and 100. Any ideas? Thanks. :ninja:
oO;;
Link to comment
Share on other sites
6 answers to this question
Recommended Posts