Form the greatest and the smallest 4-digit numbers by using any one

Form the greatest and the smallest 4-digit numbers by using any one of the digit 8,0,4 twice.

The greatest number = 8840, since 8 is the biggest digit repeat it; followed by 4 and then by 0.

The smallest number = 4008, 0 cannot come at thousands place and at thousands and hundreds place simultaneously because the number will then become 2-digit or 3-digit (0048 or 0408). 4 is smaller than 8 so it comes first. Since 0 is the smallest digit repeat it; followed by 8.