(OnlineGDB) #include <stdio.h>int main(void) {int a;char *s;int v0 = 4, v1 = 5, v2 = 6, v3 = 1, v4 = 2;printf("Exercise 1:\n====================\n");switch(v0) {case 0: printf("Hello October\n"); break;case 1: printf("Go Kean!\n"); break;case 2: printf("Academic Building Center \n"); break;case 3: printf("UNION \n"); break;case 4: printf("Go ");case 5: printf("Kean! \n");default: printf("Have a great semester! \n"); break;}for(a=5; a<v1; a++) {printf("Kean");}printf("\n");if (v2 == 6) {s = "Go";}else {s = "Hello";}if(v3 != v4) {printf("%s Kean!\n",s);} else {printf("%s Computer Science!\n",s);}return 0;} Assume the following codes are added between line 36 (}) and line 38 (return 0;) v0>0 ? ++v1, ++v2 : --v3; Please give the values of v0, v1, v2, v3, and v4 after this line and explain the reason. You can test the program to verify your answer if you like.
(OnlineGDB)
#include <stdio.h>
int main(void) {
int a;
char *s;
int v0 = 4, v1 = 5, v2 = 6, v3 = 1, v4 = 2;
printf("Exercise 1:\n====================\n");
switch(v0) {
case 0: printf("Hello October\n"); break;
case 1: printf("Go Kean!\n"); break;
case 2: printf("Academic Building Center \n"); break;
case 3: printf("UNION \n"); break;
case 4: printf("Go ");
case 5: printf("Kean! \n");
default: printf("Have a great semester! \n"); break;
}
for(a=5; a<v1; a++) {
printf("Kean");
}
printf("\n");
if (v2 == 6) {
s = "Go";
}
else {
s = "Hello";
}
if(v3 != v4) {
printf("%s Kean!\n",s);
} else {
printf("%s Computer Science!\n",s);
}
return 0;
}
Assume the following codes are added between line 36 (}) and line 38 (return 0;) v0>0 ? ++v1, ++v2 : --v3; Please give the values of v0, v1, v2, v3, and v4 after this line and explain the reason. You can test the program to verify your answer if you like.

Step by step
Solved in 2 steps with 1 images







