Write a program that requests the user’s first name and then the user’s last name. Have it print the entered names on one line and the number of letters in each name on the following line. Align each letter count with the end of the corresponding name, as in the following:

Melissa Honeybee 

       7           8

Next, have it print the same information, but with the counts aligned with the beginning of each name.

 Melissa Honeybee 

 7        8 




=> 근데 이게 성과 이름의 끝 글자에, 혹은 첫글자에 맞추어 출력해야하는데 어떻게 조정해야할지를 모르겠네요 ㅠㅠ


7. Write a program that sets a type double variable to 1.0/3.0 and a type float variable

to 1.0/3.0. Display each result three times—once showing four digits to the right of the

decimal, once showing 12 digits to the right of the decimal, and once showing 16 digits 

to the right of the decimal. Also have the program include float.h and display the

values of FLT_DIG and DBL_DIG . Are the displayed values of 1.0/3.0 consistent with these

values?




8. Write a program that asks the user to enter the number of miles traveled and the number

of gallons of gasoline consumed. It should then calculate and display the miles-per-gallon

value, showing one place to the right of the decimal. Next, using the fact that one gallon

is about 3.785 liters and one mile is about 1.609 kilometers, it should convert the mileper-

gallon value to a liters-per-100-km value, the usual European way of expressing fuel

consumption, and display the result, showing one place to the right of the decimal. Note

that the U. S. scheme measures the distance traveled per amount of fuel (higher is better),

whereas the European scheme measures the amount of fuel per distance (lower is better).

Use symbolic constants (using const or #define ) for the two conversion factors.




=> 여기 까지는 소스를 꾸역꾸역 짜봤는데

갤런당 마일 수를 유럽 스타일인 100킬로미터 당 리터 수로 변환하여 그 결과를 소수점 아래 1자리까지 출력해야한다. 를  어떻게 해야하나요 ?

%.1lf 로 표현하면 될 것 같은데 어떻게 해야하나요?