The fill character is set to sign “#”. The set() properties are set to internal and scientific. The scientific properties display the number in float format. The internal properties display the sign before blank spaces. Develop a C++ program to implement it. # # # - 7 8 4 . 5 0
#include<iostream>
#include<iomanip>
using namespace std;
int main(){
float a=-784.50;
cout<<setfill('#')<<setw(10);
cout<<fixed<<setprecision(2)<<a<<endl;
}
Comments
Leave a comment