Print 200 with and without a sign - C++ File Stream

C++ examples for File Stream:cout

Description

Print 200 with and without a sign

Demo Code

#include <iomanip>
#include <iostream>
#include <limits>

int main(int argc, const char *argv[]) {
    // w  ww  .j  a  v a 2 s. c o  m
    std::cout << std::showpos << 200 << "\n" << std::noshowpos << 200 << std::endl;
    return 0;
}

Result


Related Tutorials