Write a program which defines five variables which store the-02325
This subjective question is related to the book/course vu mth718 Topics in Numerical Methods. It can also be found in vu mth718 Mid Term Solved Past Paper No. 4.
Question 1:
xxxxxx1500
xxxxx20000
xxxxx30000
xxxxx60000
#include <iomanip.h>
main(){
int sal1 =1000;
int sal2 =1500;
int sal3 =20000;
int sal4 =30000;
int sal5 =60000;
cout << setfill ('x') << setw (10);
Write a program which defines five variables which store the salaries of five employees, using setw and setfill manipulators to display all these salaries in a column.
Note: Display all data with in a particular width and the empty space should be filled with character x
Output should be displayed as given below:
xxxxxx1000xxxxxx1500
xxxxx20000
xxxxx30000
xxxxx60000
Answer:
#include <iostream.h>#include <iomanip.h>
main(){
int sal1 =1000;
int sal2 =1500;
int sal3 =20000;
int sal4 =30000;
int sal5 =60000;
cout << setfill ('x') << setw (10);