Multiple choice technology programming languages

what is the output for printf ("%06.2f", $amt) when $amt = 9.355 ?

  1. 9.3550

  2. 9.4

  3. 009.40

  4. Error

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

In Perl (or C/SAS formatting), %06.2f formats a float to have 2 decimal places and a minimum width of 6 characters, padded with leading zeros. $amt = 9.355 rounds to 9.40 (5 characters: '9', '.', '4', '0'). To reach 6 characters, a leading zero is prepended, yielding 009.40.