Hi I am doing a basic assignment dealing with arrays. When I call to the fourth element in the array which is 12.0 and try to display it, it prints 0.
I don't see what I am doing wrong. Here is my code:
This is my output:Code:#include <stdio.h> double x[ ] = { 16.0, 12.0, 6.0, 8.0, 12.0, 14.0, 14.0, -54.5 }; int i = 2; int main(void) { printf("%d %.lf\n", 4, x[4]); printf("%d %.lf\n", i, x[i]); printf("%.lf\n", x[i] + 1); }
4 0
2 0
0