int main(void) { int a; char *s; int v0 = 9, v1 = 0, v2 = 0, v3 = 0; printf("Exercise 1:\n====
Run the following code and answer the questions.
#include <stdio.h>
int main(void) {
int a;
char *s;
int v0 = 9, v1 = 0, v2 = 0, v3 = 0;
printf("Exercise 1:\n====================\n");
switch(v0) {
case 0: printf("Good day\n"); break;
case 1: printf("Hey There!\n"); break;
case 2: printf("No Name\n"); break;
case 3: printf("Yes Please\n"); break;
case 4: printf("Go ");
case 5: printf("Vamos!\n");
default: printf(" "); break;
}
for(v1; v1<v2; v1=v1+v1) {
printf("Vamos ");
}
printf("\n");
if (v2 == 6) {
s = "Go";
}
if(v3 != 0) {
printf("%s VAMOS!\n",s);
}
return 0;
}
- What is the output of the
program ? Please explain why using the variables v0, v1, v2, and v3. - The code has a vulnerability that can prevent the program from outputting properly. Explain what the problem is. What are the values of v0, v1, v2, and v3 that may cause such problem?

Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images









