Given an char variable last that has been initialized to a lowercase letter, write a loop that displays all possible combinations of two letters in the range ‘a’ through last.

Given an char variable last that has been initialized to a lowercase letter, write a loop that displays all possible combinations of two letters in the range ‘a’ through last.

LANGUAGE: C++

CHALLENGE:

Given an char variable last that has been initialized to a lowercase letter, write a loop that displays all possible combinations of two letters in the range ‘a’ through last. The combinations should be displayed in ascending alphabetical order:

For example, if last was initialized to ‘c’ the output should be aa
ab
ac
ba
bb
bc
ca
cb
cc

This content requires that you purchase additional access. The price is $2.99 or free for our Make Life Easier and 30 Days – Not Recurring members.

Purchase this Content ($2.99) Choose a Membership Level