Ask a New Question

Asked by sara

what would the output of this code be?

int startDay = 6;
int day = 22;
switch(startDay)
{
case 5: day += 1;
case 6: day = day + 1;
case 0: ++day;
case 1: day++;
case 2: day += 1;
default: day = day + 1;

}
printf("day: %d\n", day);

the answer is 27, but i thought it would just do case 6, so day +1 so 23
10 years ago

Answers

Related Questions

How much more output will the average American have next year if the $11 trillion U.S. economy grows... What is 0 thru 5 and output on Input. Output 5. 17 8. 26... what is the output from any input that has been processed through a hashing algorithm/function. Dig... What will be the output of the code ? Execute your code using the Trinket . What will be the output of this program? var number = 5; var greater_than_zero = number > 0;... What will be the output when the following code runs? function start(){ var loggedIn = false... the output is eight less than three times the input What would be the output if the input is 10 f (x) =4x +3 13 43 1/2 17 What is the output of f when x = -6?
Ask a New Question
Archives Contact Us Privacy Policy Terms of Use