CSecure | https//blackboard.ndus.edu/webapps/assessment/take/lau nch.jsp?course
ID: 3750355 • Letter: C
Question
CSecure | https//blackboard.ndus.edu/webapps/assessment/take/lau nch.jsp?course assessment id _134449 1&course_id 55773_1&content id- 2559962 18isPasswe Remaining Time: 1 hour, 05 minutes, 46 seconds. Question Completion Status: QUESTION 41 What is printed to the screen when the following is executed. Assume that each space in the text is only one space (no double spacing) int h 15 printf'The value is 6d", hl: QUESTION 42 What would the conversion specifier be to print our an integer in the following format? QUESTION 43 In C, use one declaration to create two variables, height and width. They are integers. Click Save and Submit to save and submit. Click Save All Answers to save all answers.Explanation / Answer
Answer 41 : "The value is 15"
int h = 15;
printf("The value is %d",h);
printf will just replace the %d with the value of h defined above.
Therefore the answer is "The value is 15"
Answer 42: "%03d"
"%03d" is the right answer as it will print integer as 3 digit if there are no 3 digit then if will prefix 0 with original number.
Answer 43: "int height, width;"
In C we can declare multiple variable in single line using comma separation just like above, we can also set value while declaring like
"int height = 1, width = 2;"