Leading && Trailing 0 in C++ on September 12, 2019 Get link Facebook X Pinterest Email Other Apps #include<bits/stdc++.h> using namespace std; int main() { int n = 3333; cout<< left << setw(6) << setfill('0') << n << endl; cout << right << setw(6) << setfill('0') << n << endl; return 0; } Comments
Comments
Post a Comment