decising how many numbers after comma c 2b 2b

Solutions on MaxInterview for decising how many numbers after comma c 2b 2b by the best coders in the world

showing results for - "decising how many numbers after comma c 2b 2b"
Henry
17 Jun 2017
1#include <iostream>
2#include <iomanip>
3
4int main(int argc, char** argv)
5{
6    float testme[] = { 0.12345, 1.2345, 12.345, 123.45, 1234.5, 12345 };
7
8    std::cout << std::setprecision(2) << std::fixed;
9
10    for(int i = 0; i < 6; ++i)
11    {
12        std::cout << testme[i] << std::endl;
13    }
14
15    return 0;
16}
similar questions