/* This file contains program related to console input and output */
#include
#include
// 1. Program shows the application of setf function for left padding
int main()
{
cout.width(20);
cout.setf(ios::left,ios::adjustfield);
cout.fill('*');
cout<<"IT";
}
//2. Program shows the application of setf function right padding
int main()
{
cout.width(20);
cout.setf(ios::right,ios::adjustfield);
cout.fill('*');
cout<<"IT";
}
//3. Program shows the application of internal
int main()
{
cout<<-3 .15="" n="" p=""> cout.width(20);
cout.setf(ios::internal,ios::adjustfield);
cout.fill('*');
cout<<-3 .15="" p="">}
//4. Program shows the application scientific
int main()
{
cout<<-3 .15="" n="" p=""> cout.width(20);
cout.setf(ios::scientific,ios::floatfield);
cout.fill('*');
cout<<-3 .15="" p="">}
//5. Program to print of Hexa Decimal, Octal, Decimal No.
int main()
{
int x = 65;
cout.width(20);
cout.setf(ios::hex,ios::basefield);
cout<<"\n Hexa -> "< cout.setf(ios::oct,ios::basefield);
cout<<"\n Octal -> "< cout.setf(ios::dec,ios::basefield);
cout<<"\n Dec -> "<}
-3>-3>-3>-3>
#include
#include
// 1. Program shows the application of setf function for left padding
int main()
{
cout.width(20);
cout.setf(ios::left,ios::adjustfield);
cout.fill('*');
cout<<"IT";
}
//2. Program shows the application of setf function right padding
int main()
{
cout.width(20);
cout.setf(ios::right,ios::adjustfield);
cout.fill('*');
cout<<"IT";
}
//3. Program shows the application of internal
int main()
{
cout<<-3 .15="" n="" p=""> cout.width(20);
cout.setf(ios::internal,ios::adjustfield);
cout.fill('*');
cout<<-3 .15="" p="">}
//4. Program shows the application scientific
int main()
{
cout<<-3 .15="" n="" p=""> cout.width(20);
cout.setf(ios::scientific,ios::floatfield);
cout.fill('*');
cout<<-3 .15="" p="">}
//5. Program to print of Hexa Decimal, Octal, Decimal No.
int main()
{
int x = 65;
cout.width(20);
cout.setf(ios::hex,ios::basefield);
cout<<"\n Hexa -> "<
cout<<"\n Octal -> "<
cout<<"\n Dec -> "<