nerdexam
Zend

200-530 · Question #135

What is the output of the following code? printf('%4$d %2$s sit on 2 trees and eat %3$3.2f %1$s', "bananas", "monkeys", 9, 99);

The correct answer is B. 99 monkeys sit on 2 trees and eat 9.00 bananas. See the full explanation below for the reasoning.

Question

What is the output of the following code? printf('%4$d %2$s sit on 2 trees and eat %3$3.2f %1$s', "bananas", "monkeys", 9, 99);

Options

  • A%4$d %2$s sit on 2 trees and eat %3$3.2f %1$s
  • B99 monkeys sit on 2 trees and eat 9.00 bananas
  • CMonkeys Bananas sit on 2 trees and eat 9 99
  • D9 monkeys sit on 2 trees and eat 99 bananas

How the community answered

(47 responses)
  • A
    17% (8)
  • B
    72% (34)
  • C
    4% (2)
  • D
    6% (3)

Community Discussion

No community discussion yet for this question.

Full 200-530 Practice