Why this statement is legal C statement?? int apple = ‘c’ ;
Why this statement is legal C statement?? int apple = ‘c’ ; Isn't int for numbers??
its legal because C reads every character as an integer. for instance, test this: int apple = 'a'; printf("int: %d\nchar: %d",apple,apple); // will print 97 a because to C, the character 'a' and the number 97 are the same thing.
Integer for any known character is its ASCII value in most programming language. Refer this: http://www.asciitable.com/
Why won't my image display
I have made a calculator in which my % (Percentage) not work correctly for 100%50 or 100%20.
How the answer is 50?
Number of Ones ( C++ ) question!
why is this code not working?