logo elektroda
logo elektroda
X
logo elektroda

[C++] Setprecision(2) Not Showing Decimal Point Results in Float Calculation

Clubber 20482 0
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 7855923
    Clubber
    Level 15  
    Hello.
    I don't know how to print the result after the decimal point, even though I used setprecision (2) ..
    [code:1:384ebe9e9a]#include
    #include
    #include

    using namespace std;
    int main(int argc, char *argv[])
    {
    float wynik, H, D;
    cin >> H;
    cin >> D;
    wynik=(H*H-D*D)/(2*H);
    cout > D;
    wynik=(H*H-D*D)/(2*H);
    cout
  • ADVERTISEMENT
ADVERTISEMENT