Tuesday, 27 August 2013

printing double array in C

printing double array in C

I want to print double array elements and this is a piece of code
double array[10];
double a=20;
double b=10;
int i=0;
for(i=0;i<sizeof(array)/sizeof(double);i++)
{
array[i]=a/b;
printf("%d",array[i]);
}
but it keeps printing zeros not the real value why ?

No comments:

Post a Comment