0% found this document useful (0 votes)
9 views

C

Uploaded by

prakashrajav96
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

C

Uploaded by

prakashrajav96
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

#include <iostream>

#include <istream>

#include <sstream>

#include <string>

using namespace std;

int main()

istringstream str(" Programmer");

string line;

// Ignore all the whitespace in string

// str before the first word.

getline(str >> std::ws, line);

// you can also write str>>ws

// After printing the output it will automatically

// write a new line in the output stream.

cout << line << endl;

// without flush, the output will be the same.

cout << "only a test" << flush;

// Use of ends Manipulator

cout << "\na";

// NULL character will be added in the Output

cout << "b" << ends;

cout << "c" << endl;

return 0;

}
#include <iomanip>

#include <iostream>

using namespace std;

int main()

double A = 100;

double B = 2001.5251;

double C = 201455.2646;

// We can use setbase(16) here instead of hex

// formatting

cout << hex << left << showbase << nouppercase;

// actual printed part

cout << (long long)A << endl;

// We can use dec here instead of setbase(10)

// formatting

cout << setbase(10) << right << setw(15)

<< setfill('_') << showpos

<< fixed << setprecision(2);

// actual printed part

cout << B << endl;

// formatting

cout << scientific << uppercase

<< noshowpos << setprecision(9);

// actual printed part

cout << C << endl;

You might also like