Which of the following correctly describe the output of the ANSI C function below, if passed a value of "5"?
Which of the following correctly describe the output of the ANSI C function below, if passed a value of "5"?
#include<stdio.h
void process(int i)
{
printf("begin\n");
switch (i)
{
case 5:
printf("slow\n");
case 6:
default:
printf("halt\n");
case 1:
case 2:
printf("waiting\n");
break;
case 3:
printf("forward\n");
goto cleanup;
case 4:
printf("reverse\n");
break;
}
printf("end\n");
return;
cleanup:
/* ... */
}
A) begin
slow
halt
B) begin
slow
end
C) begin
end
D) begin
slow
halt
waiting
E) begin
slow
halt
waiting
end
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 3 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![C++ for Engineers and Scientists](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_smallCoverImage.gif)
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
![C++ for Engineers and Scientists](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_smallCoverImage.gif)
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)