Hi Guys,
So i am using a loop to fill an array from user input.
Whats the difference between a float and a double because I am not worried:
Input 1 2 3 4 5Code:double init_T[4]={0}; for (i = 0; i <= 4; i++) { //init_T[i] = i+2; scanf("%f",&init_T[i]); } for (i = 0; i <= 4; i++) { printf("%f\n",init_T[i]); }
Output
1
2
3
4
5
then change the array to a type double and Output becomes:
0.00
0.00
0.00
0.00
0.56556
Why does the double change everything?