0

Converting 88.54 into 000000008854

the digits should be 12..the values after decimal points should not be neglected

12th Jul 2018, 7:59 AM
Tamil Arasan
Tamil Arasan - avatar
2 odpowiedzi
+ 2
Please elaborate on which language you expect the solution on, and show your attempt so far on the problem. Here's some examples: *** C++ *** #include <iostream> #include <iomanip> int main() { double n {88.54}; std::cout << std::setw(12) << std::setfill('0') << std::setprecision(0) << std::fixed << n * 100.0; return 0; } *** C Language *** #include <stdio.h> int main() { double n = 88.54; printf("%012.0f\n", (n * 100.0)); return 0; } *** PHP *** <?php $n = 88.54; printf("%012.0f\n", ($n * 100.0)); ?> You need to indicate the language involved in your tag to get better response. Hth, cmiiw
12th Jul 2018, 2:17 PM
Ipang
0
Hi Tamil Arasan, What's your question?
12th Jul 2018, 8:16 AM
Janning⭐
Janning⭐ - avatar