3 votes 3 votes What will be the output of the following code? #include <stdio.h> int main() { char a = 'A', z = 'Z'; printf("%d", z-a); } Programming in C go-programming-1 programming programming-in-c numerical-answers + – Arjun asked Oct 18, 2016 Arjun 773 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 6 votes 6 votes Here we don't even need to remember the ASCII codes For A: ASCII of A = x For B: ASCII of B = x+1 : For Z: ASCII of Z = x+25 Hence z-a = x+25 - x = 25 Prajwal Bhat answered Jan 5, 2017 selected Feb 7, 2017 by Arjun Prajwal Bhat comment Share Follow See all 0 reply Please log in or register to add a comment.
2 votes 2 votes a = ASCII of A = 44 z = ASCII of Z = 69 z-a = 69-44 = 25 Digvijay Pandey answered Oct 20, 2016 edited Jan 10, 2017 by Vijay Thakur Digvijay Pandey comment Share Follow See 1 comment See all 1 1 comment reply Jason_Roy commented Feb 7, 2017 reply Follow Share ASCII of A is 65???? 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes Here value is print by ascii code conversion . let suppose a=1 and z=26 because total number of character present is 26 a is 1st and z is 26th character of alphabhat so z-a= 26-1=25 so 25 will be printed SHIVAM GARG answered Jul 25, 2018 SHIVAM GARG comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes ASCII value of z - ASCII value of a = 25. See: https://gateoverflow.in/55882/ugcnet-june2012-ii-38 JashanArora answered Dec 13, 2019 JashanArora comment Share Follow See all 0 reply Please log in or register to add a comment.