Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Zend 200-710 Exam - Topic 2 Question 78 Discussion

Actual exam question for Zend's 200-710 exam
Question #: 78
Topic #: 2
[All 200-710 Questions]

What will the following function call print?

printf('%010.6f', 22);

Show Suggested Answer Hide Answer
Suggested Answer: C

Contribute your Thoughts:

0/2000 characters
Barbra
4 months ago
No way, it should just be 22!
upvoted 0 times
...
Eliseo
4 months ago
Wait, why does it have leading zeros?
upvoted 0 times
...
Hillary
4 months ago
I thought it would be C at first.
upvoted 0 times
...
Leota
5 months ago
Definitely option D!
upvoted 0 times
...
Tamar
5 months ago
It will print 22.000000.
upvoted 0 times
...
Caitlin
5 months ago
I feel like it should be "22.000000" since the total width is 10, but I can't recall if the leading zeros apply to the whole number or just the integer part.
upvoted 0 times
...
Tayna
5 months ago
I'm a bit confused about the leading zeros. Does it mean it will print "022.000000"? That sounds familiar.
upvoted 0 times
...
Elvera
5 months ago
I remember practicing something similar, and I think it might print "22.000000" because of the .6f specifier.
upvoted 0 times
...
Lizette
6 months ago
I think the function call will format the number with leading zeros, but I'm not sure if it will include the decimal part.
upvoted 0 times
...
Portia
6 months ago
I've got this! The answer is D. The printf function will convert the integer 22 to a floating-point number and print it with 6 decimal places, padded with zeros to make it 10 characters wide.
upvoted 0 times
...
Marnie
6 months ago
Wait, is the answer C? I'm a bit confused, I thought the printf function would just print the integer value as is.
upvoted 0 times
...
Jeannetta
6 months ago
Okay, I think I know this one. The format specifier '%010.6f' will print the number with 10 total characters, including 6 decimal places, and pad the left side with zeros.
upvoted 0 times
...
Dorothy
6 months ago
Hmm, this looks like a formatting question. I'll need to think carefully about the printf format specifier and how it will handle the integer value of 22.
upvoted 0 times
...
Nieves
1 year ago
Ah, the age-old question: how many zeros can you fit in front of a number before it becomes a completely different number? The answer is 'as many as you want, as long as you're feeling lucky'.
upvoted 0 times
...
Rickie
1 year ago
Wait, why are we printing the value of '22' to 6 decimal places? Is this some kind of secret code to unlock the secrets of the universe?
upvoted 0 times
Youlanda
1 year ago
D) 22.000000
upvoted 0 times
...
Royce
1 year ago
C) 022.000000
upvoted 0 times
...
Reita
1 year ago
B) 22.00
upvoted 0 times
...
Jillian
1 year ago
D) 22.000000
upvoted 0 times
...
Lavonda
1 year ago
C) 022.000000
upvoted 0 times
...
Yvonne
1 year ago
A) 22
upvoted 0 times
...
Tandra
1 year ago
B) 22.00
upvoted 0 times
...
Milly
1 year ago
A) 22
upvoted 0 times
...
...
Tayna
2 years ago
I'm not sure, but I think it's A) 22
upvoted 0 times
...
Ozell
2 years ago
Hold on, is this a trick question? What if the function is actually supposed to print '22.000000' but the formatting is just really weird? I'll go with B, just to be safe.
upvoted 0 times
Natalie
1 year ago
I believe it will print 022.000000
upvoted 0 times
...
Lovetta
1 year ago
I'm not sure, but I think it will print 22.00
upvoted 0 times
...
Joaquin
1 year ago
I think it will print 22.000000
upvoted 0 times
...
...
Nickolas
2 years ago
This is too easy. The answer is clearly C. Who even needs to think about this?
upvoted 0 times
...
Peter
2 years ago
I believe it will print D) 22.000000
upvoted 0 times
...
Adolph
2 years ago
I think the answer is C) 022.000000
upvoted 0 times
...
Julio
2 years ago
I'm going with D. The function call is clearly asking for the value to be printed to 6 decimal places, and 22 is the correct answer.
upvoted 0 times
...
Rosann
2 years ago
Definitely C! That's the only option that matches the formatting specified in the function call.
upvoted 0 times
Brynn
1 year ago
D) 22.000000
upvoted 0 times
...
Wilda
1 year ago
C) 022.000000
upvoted 0 times
...
Sue
1 year ago
B) 22.00
upvoted 0 times
...
Lachelle
1 year ago
A) 22
upvoted 0 times
...
...

Save Cancel