Es ghet um folgenden ganz simplen Code. Das Ergebnis sollte ja 12,5 sein aber in der Ausgabe steht 12.00?! Programmieren tu ich mit Code-Blocks Wo liegt das Problem am Code, Compiler??? und wenn ich nur a=3/6; einsetze kommt 0.00 raus... Die Rechenoperation für "geteilt" : ist doch "/"
1 | #include <stdio.h> |
2 | |
3 | int main(void) |
4 | {
|
5 | float a; |
6 | |
7 | a=25*3/6; |
8 | |
9 | printf("Albert = %.2f",a); |
10 | |
11 | return 0; |
12 | }
|