Question: Write a C Program to 1) print all possible strings of length 2 that can be formed from ABCD Input: ABCD Output: AA, AB, AC,

Write a C Program to

1) print all possible strings of length 2 that can be formed from "ABCD"

Input: ABCD

Output: AA, AB, AC, AD, BA, BB, BC, BD, CA, CB, CC, CD, DA, DB, DC, DD

2) divide the string "ABCDEF" into 3 parts, going through each letter and count the number of times each pattern from part (1) occurs in each line of the output:

Input:

ABCDEF

Output:

ABC

BCD

CDE

DEF

No. of times AA occurs in ABC: 0

No. of times AA occurs in BCD: 0

No. of times AA occurs in CDE: 0

No. of times AA occurs in DEF: 0

No. of times AB occurs in ABC: 1

No. of times AB occurs in BCD: 0

.

.

.

.

.

No. of times DD occurs in DEF: 0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!