1. Why range of float constants is much more than integer constants ?
2. Can i write an entire C program in a single line including all preprocessors. If yes, how ?
3. As per the definition, a character variable can hold only one character constant at time. But suppose if i declare a character variable with bogus input and print it's value as shown below,
1 2
char ch = 'winner';
printf("\nch = %c",ch);
I get the output "r", the last character (Code::Blocks). And these warnings,
1 2
warning: character constant too longfor its type
warning: overflow in implicit constant conversion
So, it looks like last character is assigned to character variable. I understand the first warning. But what about the second, that led to the storage of 'r' in character variable "ch" ?
1) It has to do with how floating point values are stored. They include data bits for an exponent, allowing you to store very large but less precise numbers.
2) I actually do not think so. Preprocessor commands are terminated with newlines.
3) I would think that shouldn't even compile. Single quotes are for character literals only, not string literals. Anything it would do in that case that it does somehow run would be implementation defined.