0 votes 0 votes static char{}="NO SUBSTITUTE FOR HARD WORK"; Printf("%10.5s", wer); Outputs a) NO SU B) NO SUBSTIT C) UTE F neha singh asked Mar 5, 2017 • edited Mar 6, 2017 by sh!va neha singh 1.8k views answer comment Share Follow See 1 comment See all 1 1 comment reply Vipin Kumar Dubey commented Sep 27, 2019 reply Follow Share in case of printf("%-10.*s" hh, wer); what will be output? 0 votes 0 votes Please log in or register to add a comment.
Best answer 2 votes 2 votes C interprets Printf("%10.5s", as: % means "Print a variable here" .5 means " print first five character including blank space" 10 means "use at least 10 spaces to display, padding as needed". in this example print 10-5 = 5 spaces before the characters Answer will be a) NO SU sh!va answered Mar 6, 2017 • edited Mar 6, 2017 by sh!va sh!va comment Share Follow See all 3 Comments See all 3 3 Comments reply neha singh commented Mar 6, 2017 reply Follow Share @Shiva what is the output if -10.5s is there instead of 10.5s? 0 votes 0 votes sh!va commented Mar 6, 2017 reply Follow Share @ Neha: In case of -10.5, Blank spaces will be added after printing characters NO SU 0 votes 0 votes sh!va commented Mar 6, 2017 reply Follow Share http://www.c4learn.com/c-programming/c-formatting-printf/ Please go through this link. It explains printf formatting in simple minimum easier way.. Hope it will be useful 0 votes 0 votes Please log in or register to add a comment.