Create an output format statement which would generate lines

Create an output format statement which would generate lines in the table which appear as shown below. The Employee Name Field displays an employee name contained in the name variable. YYY displays an integer value from the age variable which ranges from 1 thru 100 and should be right justified. XXXXX.XX displays a monetary value from the salary variable which ranges from 0.01 to 99999.99 and should also be right justified. Use the variables shown below in your output statements.

Employee Name Field------YYY----$XXXXX.XX

char name[25]; int age; double salary;

Solution

printf(\"%s%-13d\",name,age);

printf(\"$%5.2lf\",salary);//implement precision

//Implement double value with max 5 integers //and2decimal numbers

Create an output format statement which would generate lines in the table which appear as shown below. The Employee Name Field displays an employee name contain

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site