PDA

View Full Version : [SOLVED] output??



Praveen30
February 9th, 2011, 01:33 PM
#include<stdio.h>
void main()
{
float a[]={13.24,1.5,1.5,5.4,3.5};
float *j;
j=a;
j=j+4;
printf("%d%d%d",j,*j,a[4]);
}



when i am running this programme on turbo c compiler, i am getting -1400.why???

fct
February 9th, 2011, 01:54 PM
First, j is a pointer, print with "%x" to get the hex address.

Second, *j is a reference to a number in a[], that is a floating point number. Use "%f". Same for the next one.

Third, please use proper separators for different values. "\n" would be nice.