0 votes 0 votes What is the output?? saumya mishra asked Dec 12, 2018 saumya mishra 422 views answer comment Share Follow See all 3 Comments See all 3 3 Comments reply Satbir commented Dec 12, 2018 i edited by Satbir Dec 12, 2018 reply Follow Share 424 %% would be the outputs (sizeof('3') -> return the size of assci value of character which an integer sizeof("3")-> returns 2 bcoz it is a string and in this case it would return no. of elements in string which are 3 and /0. sizeof(3)-> returns size of integer ) these values are compiler dependent and i have assumed int is of 4 1 votes 1 votes saumya mishra commented Dec 12, 2018 reply Follow Share Yes but why for second one only 2 %% are printed please explain??? 0 votes 0 votes Deepanshu commented Dec 12, 2018 reply Follow Share saumya mishra actually % is generally used for identify that what type we have ? means int , char , str or other many fields so when first one comes we are excpecting 2nd one to something like that The character % is followed by one of the following characters. The flag character The field width The precision The length modifier The conversion specifier: see link https://www.geeksforgeeks.org/how-to-print-using-printf/ 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes Anser is 111 (111 is because inside the printf statement sizeof get some integer value so that its return 1 (true) value ) and %%(Here if put %% it will print single % ) Rackson answered Dec 12, 2018 edited Dec 12, 2018 by Rackson Rackson comment Share Follow See 1 comment See all 1 1 comment reply saumya mishra commented Dec 12, 2018 reply Follow Share Answer is b. 0 votes 0 votes Please log in or register to add a comment.