Computer Science, asked by Anonymous, 1 year ago

Write a C++ program to illustrate how a character is filled in the unused field width of the value of the data variable.




(Answer if you know otherwise no need to attempt for spamming.)

Answers

Answered by Anonymous
8

Hey there!


Here's your code.





/* Program to illustrate how a character is filled in the unused field width of the value of the data variable

* Program by : Mahnaz

*/


#include <iostream>

#include <iomanip>

using namespace std;


int main()

{

 

int a, b;

 

a = 500;

 

b = 100;


cout << setfill ('*');


cout << setw (4) << a << setw (4) << b << endl;

 

cout << setw (5) << a << setw (5) << b << endl;

 

cout << setw (6) << a << setw (6) << b << endl;

 

cout << setw (7) << a << setw (7) << b << endl;


cout << setw (8) << a << setw (8) << b << endl;


}





_______________________________

See the attachment for proper review.

_______________________________

Attachments:

Anonymous: thank you
Similar questions