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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started