#include #include using namespace std; int main() { double a, b, c; a=1234.5678; b=1133431.3134; c=88; cout << "c = " << noshowpoint << c << endl << endl; cout << "a = " << a << endl; cout << "b = " << b << endl; cout << "c = " << c << endl << endl; cout << "a = " << setprecision(2) << fixed << a << endl; cout << "b = " << setprecision(2) << fixed << b << endl; cout << "c = " << setprecision(2) << fixed << c << endl << endl; cout << "a = " << setprecision(2) << scientific << a << endl; cout << "b = " << setprecision(2) << scientific << b << endl; cout << "c = " << setprecision(2) << scientific << c << endl << endl; cout.precision(3); cout << "a = " << showpoint << a << endl; cout << "b = " << showpoint << b << endl; cout << "c = " << showpoint << c << endl << endl; // memory size of several frequently used data type cout << "The size of boolean is: "<< sizeof(bool) << " Bytes\n"; cout << "The size of character is: "<< sizeof(char) << " Bytes\n"; cout << "The size of integer is: "<< sizeof(int) << " Bytes\n"; cout << "The size of float is: "<< sizeof(float) << " Bytes\n"; cout << "The size of double is: "<< sizeof(double) << " Bytes\n"; cout << "The size of long integer is: "<< sizeof(long int) << " Bytes\n"; // showing the difference between p++ and ++p; int p, q; p=3; q=p++; cout << "p=3; q=p++;" << endl; if (p==4 && q==3) // introduce the operator && cout << "p=3 and q=4" << endl; else if (p==4 && q==4) cout << "p=4 and q=4" << endl; // first, q=p; then p++; // therefore, q=3 and p=4 after this statement p=3; q=++p; cout << "p=3; q=++p;" << endl; if (p==4 && q==3) cout << "p=3 and q=4" << endl; else if (p==4 && q==4) cout << "p=4 and q=4" << endl; // first, ++p; then q=p; // therefore, q=p=4 after this statement }