edited by
1,758 views
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
edited by

1 Answer

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

edited by

Related questions

0 votes
0 votes
1 answer
1
10 votes
10 votes
1 answer
2
Arjun asked Nov 17, 2014
3,322 views
main() { int i =300; char *ptr=&i; *++ptr=2; printf("%d",i); }
0 votes
0 votes
1 answer
3