0 votes 0 votes Programming in C programming programming-in-c + – Shivam Chauhan asked Dec 9, 2017 Shivam Chauhan 418 views answer comment Share Follow See all 6 Comments See all 6 6 Comments reply Show 3 previous comments Shivam Chauhan commented Dec 9, 2017 i edited by Shivam Chauhan Dec 9, 2017 reply Follow Share char can be initialized as: char c = 'a' char c = 97 // ASCII value of a char c = '\141' // octal value of a char c = '\x61' // hex value of a Ace academy took it as: '\08' octal value but octal value can take only 0 to 7 values so they gave compile error But @joshi_nitish Thanks Compiler took it as multicharacter and c = ASCII Value of 8 = 56 1 votes 1 votes just_bhavana commented Dec 9, 2017 reply Follow Share @Shivam For char c = 'x61' value printed is 49, but when I simply did char c = 0x61, it prints 97 correct. why is it printing 49 in the first case ? I think for hex value of a, the correct declaration is char a = '\x61' ; 0 votes 0 votes Shivam Chauhan commented Dec 9, 2017 reply Follow Share Thanks @just_bhavana I forgot to put '\' character 0 votes 0 votes Please log in or register to add a comment.