This is my last question to answer on my homework assignment and I'm borderline about to rip my hair out If someone could please assist me
Code:
#include<stdio.h>
#include<stdlib.h>
int main()
{
int n;
int a = 2;
int b[2];
int c = 3;
int i;
scanf("%d", &n);
for(i = 0; i < n; i++){
b[i] = n * i;
}
printf("value of a=%d, c=%d\n", a, c);
for(i = 0; i < n; i++){
printf("b[i] = %d\n", b[i]);
}
return 0;
}
1.What is the problem with the above code snippet?
2.Why does it exhibit the behavior it does? Explain. How do you fix it?