Given a string in C++ such as ” BCDAG” and a number k . Write afunction in C++ that breaks this string up into strings of allposible combinations of size k and print it out with a spacebetween them. Note the output must not be characters butsrings.
Eg If k=2, the strings produced should be “BC” “CD” “DA” and”AG” .
NOTE:Only use For loops/conditional statements to solve thisproblem.
Expert Answer
An answer will be send to you shortly. . . . .