Assume that float takes 4 bytes, predict the output of following program.
#include <stdio.h>
int main()
{
float arr[5] = {12.5, 10.0, 13.5, 90.5, 0.5};
float *ptr1 = &arr[0];
float *ptr2 = ptr1 + 3;
printf("%f ", *ptr2);
printf("%d", ptr2 - ptr1);
return 0;
}
My query is, I am not getting why the output for 2nd printf statement is 3 and not 12?
Any help in this regard will be highly appreciated.