user-defined manipulation in c++

#include<iostream.h>

#include<conio.h>

ostream  & mani(ostream & out)

{

out.width(15);

out.setf(ios::showpoint);

out.fill('#');

out.precision(4);

out.setf(ios::left);

return out;

}

void main()

{

clrscr();

float a=5556;

cout<<endl;

cout<<a<<mani<<a<<endl;

getch();

}


output:-

5556.0000######

Post a Comment

If you have any doubts, Please let me know
Thanks!

Previous Post Next Post