illustrate the use of end1 and setw (Use of manipulator) of C++.
illustrate the use of end1 and setw (Use of manipulator)
#include<iostream >#include<iomanip> //for setw
using namespace std;
int main()
{
int Basic=950,Allowance=95,Total=1045;
cout<<setw(10)<<"Basic="<<setw(10)<<Basic
<<setw(10)<<"\nAllowance"<<setw(10)<<Allowance
<<setw(10)<<"\nTotal"<<setw(10)<<Total;
return 0;
}
Comments
Post a Comment