0 votes 0 votes GATE 2007 QUESTION(DOUBT) https://gateoverflow.in/3465/gate2007-it-32 Guys in this question %c is there in printf.......and ans is 25.....but why the ASCII value of 25 is not printed????? As %c is used here. Kindly help where I am getting wrong?? himanshu19 asked Aug 19, 2018 himanshu19 359 views answer comment Share Follow See all 2 Comments See all 2 2 Comments reply Shaik Masthan commented Aug 19, 2018 reply Follow Share verified... it is wrong in GATE itself... #include <stdio.h> #define EOF -1 void push (int); /* push the argument on the stack */ int pop (void); /* pop the top of the stack */ void flagError (); int main () { int c, m, n, r; while ((c = getchar ()) != EOF) { if (isdigit (c) ) push (c-'0'); else if ((c == '+') || (c == '*')) { m = pop (); n = pop (); r = (c == '+') ? n + m : n*m; push (r); } else if (c != ' ') flagError (); } printf("%d", pop ()); } coming to your question Guys in this question %c is there in printf.......and ans is 25.....but why the ASCII value of 25 is not printed????? when %c is used.... character printed, when %d is used digits ( ASCII values in case of characters ) printed 0 votes 0 votes himanshu19 commented Aug 19, 2018 reply Follow Share Thanx...got it 0 votes 0 votes Please log in or register to add a comment.