Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Rounding float to nearest 1000
//clang 3.8.0 #include <iostream> #include <cmath> using namespace std; int main() { float price; cin >> price; int roundedPrice = int(price); int remainder = roundedPrice % 1000; if (remainder != 0) { roundedPrice = roundedPrice + 1000 - remainder; } cout << "Rounded price is: " << roundedPrice; }
run
|
edit
|
history
|
help
0
marquee text in C++
<string> No indirect include of <errno.h>
Set sub sequences.
U2
regex
ArrayList Example Starter Code 2
Copy uint64 data into uint32 with padding
pointer to pointer
BinaryGap, C++ - Find longest sequence of zeros in binary representation of an integer.
Move Construction