987
the largest five digit number that can be formed using the digits 7 and 9 is 97,000
987654
99997
86420
As a string, the largest number is 7111111.
86420
It is 963.
99997
It is: 996
It is: 9996
Pressumably, you want to use each digit once. Starting from the left, use the largest digit you can every time. For example, the left-most digit should be "6".