59.5k views
3 votes
Write a loop that displays all possible combinations of two letters where the letters are 'a', or 'b', or 'c', or 'd', or 'e'. The combinations should be displayed in ascending alphabetical order and all lowercase:

User Aniket Raj
by
5.2k points

1 Answer

3 votes

Answer:

a,a

a,b

a,c

a,d

a,e,

b,a

b,b

b,c

b,d

b,e,

c,a

c,b

c,c

c,d

c,e,

d,a

d,b

d,c

d,d

d,e,

e,a

e,b

e,c

e,d

e,e.

Explanation: use of nested loop which a limited programming language of positioning a loop within a loopm

User Daizuozhuo
by
5.5k points