Please see this
IMG_20170802_184645.jpg - Google Drive
in book It is shown value of H is 74 ....what is this value ?
as per ASCII table value of H is 72
book is wrong ?
Please see this
IMG_20170802_184645.jpg - Google Drive
in book It is shown value of H is 74 ....what is this value ?
as per ASCII table value of H is 72
book is wrong ?
Yes, your book is wrong.
Almost every book published has errors.
Even K&R -> Errata for The C Programming Language, Second Edition * GitHub
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Why do you care about the actual value of a char? The number could vary outside ASCII.
For example:
The code could be tried on different Compilers and OS's and you may get varied numbers.Code:#include <stdio.h> #include <stdlib.h> int main(void) { const char ch='H'; printf("H value is %d\n",ch); return EXIT_SUCCESS; }
Also please check the header <ctype.h>.