Since here type conversion from float to charecter take place. Hence the ASCII value of the binary number present in the first byte of float variable a will print.
Vinod said:
(Sun, Apr 3, 2011 07:41:33 AM)
Can you explain how to came -61.
Durai Pandian said:
(Mon, May 23, 2011 11:35:30 AM)
Please whats the meaning of the -61 as output.
Mukesh said:
(Fri, Jun 3, 2011 04:56:12 AM)
Where the global variable stored in c language?
Shankar said:
(Thu, Jul 7, 2011 08:23:30 AM)
GLOBAL variables are store in permanent storage area i.e static memory.
@kiran Global variables are stored on data segment.
the static variables are stored on heap.
Gyni said:
(Tue, Sep 20, 2011 09:07:08 PM)
What is heap? can you segment and static memory storage.
Lalit Singh said:
(Tue, Sep 27, 2011 11:48:36 AM)
The answer to this question is wrong it's option D.
Harry said:
(Wed, Oct 5, 2011 04:19:41 PM)
Can anyone please explain ? How did this answer come ?
Priya said:
(Wed, Oct 5, 2011 10:43:29 PM)
Hut the output is -61 and it is not ASCII value of a so anyone can explain this ans?
Gourav said:
(Fri, Oct 7, 2011 07:34:05 AM)
C stores local variables on stack.
Global variables may be declared. These are not stack based. But stored in the data segment.
Rupinderjit Singh said:
(Fri, Oct 28, 2011 09:07:29 PM)
Static variables are stored on stack and Heap is only used for dynamic memory allocation.
Vipul said:
(Sat, Dec 17, 2011 06:25:31 PM)
What is heap?
Vipul said:
(Sat, Dec 17, 2011 06:28:48 PM)
Please give proper explanation.
Balaji said:
(Thu, Jan 5, 2012 11:18:09 PM)
Char takes in pointer so the first byte takes the role but print the int value so the result is the binary value of the first byte.
Vishwas said:
(Fri, Jan 6, 2012 10:31:24 AM)
Here j is a character pointer, it will hold the address of size 1 byte, but float variable value(3.140000) spread in 4 bytes.
So 1st byte of the float value get printed by the character pointer j.
Deepa said:
(Wed, Jan 11, 2012 07:56:32 PM)
Can anyone explain it clearly?
Sk Rashid Ali said:
(Sat, Feb 18, 2012 05:58:43 PM)
If we replace %d with %u its giving an addrress.
Dilip Sharma said:
(Mon, Feb 20, 2012 07:39:14 PM)
float a=3.14;
char *j;
j = (char*)&a;
printf("%d\n", *j);
return 0;
//here j is pointer to char a are declare as 3.14 which is float in third line &a is nothing but the reference of a i.e direct retrived the value 3.14 and cast it as (char*) ;
so here float value are casted.hence it will print the ASCII charactor of first byte.
Vishwas S said:
(Wed, Aug 22, 2012 04:54:56 PM)
Can anyone please explain how 3.14 is stored in a computer?
Ganesh said:
(Sat, Sep 8, 2012 10:24:26 PM)
@Vishwas
which is the 1st byte in 3.140000? 03 or 00?? whatever it is.. ascii value for 0 is 60 and that of 3 is 63.. so how can ans be -61??