A simple question in C ++, since you can see that it creates a table and enters the variable a, as well as the variable t answer, the problem is that I do not know how to fix if () . As you can see, he has an error (typo). I donโt know how to determine if the variable t has an example: 1 or 1.5 if the number is 1. (something is here and it is more than the number. 1 ), then call one else condition and call the other.
int a,b = 18; double t; for (a = 0; a <= b; a++) { t = 8 + (double)(18 - a) / 2; if (t >= *.1) cout << setw(9) << a << setw(20) << fixed << setprecision(1) << t << endl; else cout << setw(9) << a << setw(20) << t << endl; }
I tried:
#include <iostream>
Fixed in his own way, still thanks to "Angew", he first published modf ():
#include <iostream>
source share