0 0 votes void main() { float a=55555; printf("%.2E %.2e\n",a); } a)5.56E+004 8.12e+268 b)compilation error c) runtime error d)555.55E+002 Programming in C + – amkrj 1.5k views answer comment Share Follow Print See all 6 Comments 6 6 Comments reply Show 3 previous comments amkrj commented Jul 5, 2015 reply Follow flag Test ur C skill by kanetkar not exactly this question...but this type of question 0 0 replyShare Arjun commented Jul 5, 2015 reply Follow flag Surely a misprint in question, but don't follow that book for GATE. 0 0 replyShare amkrj commented Jul 5, 2015 reply Follow flag ok tnk u sir 0 0 replyShare Please log in or register to add a comment.
0 0 votes answer is A) 5.56E+004 8.12e+268 e Scientific notation (mantissa/exponent), lowercase E Scientific notation (mantissa/exponent), uppercase Pranay Datta 1 answered Jul 4, 2015 Pranay Datta 1 comment Share Follow See all 4 Comments 4 4 Comments reply amkrj commented Jul 4, 2015 reply Follow flag plz be a bit clear...........%.2E means taking 2 digit after the point...but how 004? and how got %.2e =8.12e+268 0 0 replyShare Pranay Datta 1 commented Jul 4, 2015 reply Follow flag here 0.2 means after the point we have to consider 2 digit . see 55555 = 5.5555 * E^4 = 5.56 * E^4 (round off upto 2 digit and 4 is +ve ) so 5.56E+004 0 0 replyShare Arjun commented Jul 4, 2015 reply Follow flag But how did you get the second value? 0 0 replyShare biranchi commented Jul 5, 2015 reply Follow flag I ran on Mac OS and got the below results: test.c:13:18: warning: more '%' conversions than data arguments [-Wformat] printf("%.2E %.2e\n",a); ~~~^ 1 warning generated. $ ./a.out5.56E+04 0.00e+00 After i changed the line to: printf("%.2E %.2e\n",a,a); I got the result as: ./a.out 5.56E+04 5.56e+04 1 1 replyShare Please log in or register to add a comment.