QuestionQuestion

Question 1
If each of the following printf statements was part of a complete program, what would it print?
a. printf("The answer is %10.1f ",1.2345);
b. #define QUOTE "Hopefully this will help!"
...
printf("/%10.5s/ ",QUOTE);
c. printf("x = %010d ",43);
d. printf("%c",'x4d');

Question 2
Write a single scanf statement that could be used to enter both a person's first and last name.

Question 3
Code conversion specifications for each of the following:
a. a floating point number with a field width of 12 and 5 significant digits
b. a long integer in hexadecimal format
c. an integer with leading zeros instead of leading spaces
d. a short unsigned integer

Question 4
Write a preprocessor define for the shipping charge on one box of freight (assume it is 2.75). Write a C statement that uses this define to calculate the total freight charge for the number of boxes stored in box_cnt, and place the result in tot_shp_cost.

Solution PreviewSolution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

Question 1

If each of the following printf statements was part of a complete program, what would it print?
a. printf("The answer is %10.1f ",1.2345);
The answer is       1.2

b. #define QUOTE "Hopefully this will help!"
...
printf("/%10.5s/ ",QUOTE);
/    Hopef/

c. printf("x = %010d ",43);
x = 0000000043

d. printf("%c",'\x4d');
M...
$20.00 for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available C-Family Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats