PrepAway - Latest Free Exam Questions & Answers

Which of the following pieces of code will properly assign $year, $month and $day with their respective values

You want to extract the pieces of a date string, which looks like this:
“2005-11-02”. Which of the following pieces of code will properly assign $year,
$month and $day with their respective values?

PrepAway - Latest Free Exam Questions & Answers

A.
sscanf(“2005-11-02”, ‘%d-%d-%d’, $year, $month, $day);

B.
scan(“2005-11-02”, ‘%d-%d-%d’, $year, $month, $day);

C.
sscanf(‘%d-%d-%d’, “2005-11-02”, $year, $month, $day);

D.
sscan($year, $month, $date ‘%d-%d-%d’, “2005-11-02”);

One Comment on “Which of the following pieces of code will properly assign $year, $month and $day with their respective values


Leave a Reply

Your email address will not be published. Required fields are marked *