I need to print the ASCII value of the given character in awk only.
Below code gives 0 as output:
0
echo a | awk \'{ printf(\"%d \\n\",$1)
see the awk manual for ordinal functions you can use. But since you are using awk, you should be on some version of shell, eg bash. so why not use the shell?
$ printf "%d" "'a" 97