Question: 1. Given the following C statements: = printf(10.10 printf(10.12 printf(10.15 %.151f , 10.10); %.151f , 10.12); %.151f , 10.15); = Briefly explain why 10.12 doesn't

 1. Given the following C statements: = printf("10.10 printf("10.12 printf("10.15 %.151f", 10.10); %.151f ", 10.12); %.151f ", 10.15); = Briefly explain why

1. Given the following C statements: = printf("10.10 printf("10.12 printf("10.15 %.151f ", 10.10); %.151f ", 10.12); %.151f ", 10.15); = Briefly explain why 10.12 doesn't display the value expected? 2. What are all the possible values that can be returned based on the following statements using the modulus operator (you many use a range to simplify your answer): a) intValue % 2 b) intValue % 3 c) intValue % 100 3. Apply the modulus operator in the following situation: You are hosting a party and you order 11 pizzas. Each pizza has 12 slices, and the average person eats 3 slices, and you expect 21 people at the party. How many pizza's will be completely consumed and how many extra slices will be needed to feed the expected number of guests? What does the formula look like if you write it in the C language? Fill-in the missing parts (underscored): = 11 21 3; int totalslices 12; int estimatedSlicesConsumed int wholePizzasEaten int extraslicesNeeded = = ; 4. Briefly explain why it is often a best practice to convert floating-point values to integers when performing arithmetic operations

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!