Please fix the code given, to be executed and will show the output below
Code
#include <stdio.h>
int main(){
int x[$1], i;
for(i=0;i<10;$2){
$3 = i+1;
printf("The index [%d] has a value of: %d\n", $4, x[i]);
}
return 0;
}
Output
The index x[0] has a value of: 1
The index x[1] has a value of: 2
The index x[2] has a value of: 3
The index x[3] has a value of: 4
The index x[4] has a value of: 5
The index x[5] has a value of: 6
The index x[6] has a value of: 7
The index x[7] has a value of: 8
The index x[8] has a value of: 9
The index x[9] has a value of: 10