A. 5 digit code with digits from 0-9 with no repetition.
Choices for 1st digit=10, and choices for successive digits are 9,8,7,6.
Probability of guessing it correctly on first try is
1/(10*9*8*7*6) = 1/30240
B. If zero is not in the combinations, then the domain of digits is 1-9, or 9 choices. Digits can repeat means every digit in the code has 9 choices.
Number of arrangements = 9^5 = 59049
Probability of guessing at first try = 1/59049