Why char value assignment to float is not working

c

Solution

Note that there are no `char`s here anywhere in your code.

This is the way `scanf` is supposed to work. If you check the return value from `scanf` (like you should be!) you'll probably see that it's returning 0, meaning no items were matched.

When you give `scanf()` a `"%f"` format string, that means "I want you to try and get me a floating point number. When you provide input like 'a', it's not going to match anything, because `'a'` is not a valid floating-point number.

http://www.cplusplus.com/reference/cstdio/scanf/

Problem

Note:This question is very simple but when I am searching in Google I haven't got any clear clarification. I have following program ``` int main() { float c; scanf("%f",&c); printf("%f",c); } ``` o/p when I am giving a `int` value (e,g - 9) it is showing it as 9.000000 but when I am giving char value like 'a' it is not showing and showing 0.000000.I know the `memory representation of float` is totally different from `int` but then how when I am giving `int value (9)` it is showing but when I am giving `char (a)` which is also an int (97) is not showing. How it is happening. What is the memory representation during `char` assignment.

Original source