Hello-
My teacher gave us this problem in a lab and I need help with it. Basically, he wants us to write an algorithm to count symbols. The user will provide anywhere between 3-10 symbols and then an initial number. For example:
user: 01234567, initial number: 106
output: 107, 110, 111, 112, 113, 114, 115, 116, 117, 120, 121.
user: abc, initial number: bb
output: bc, ca, cb, cc, aa, ab, ac, etc.
now after wracking my brain for the past 24 hours, i have thought to put the characters in a string, then have the initial number in another string. Then use a for loop, if statements to compare. for example:
char symbol[10];
cin>>symbol;
char initial[5];
cin>>initial;
for(int i = 0; i <5; i++)
{if (initial [5] =='\0')
if (initial [4] =='\0')
if (initial [3] =='\0')
if (initial [2] =='\0')
if (initial [1] =='\0')
for(int s=0;s<
{while( initial==symbol)
{if (symbol[i+1];
I am lost!!!! Am I on the correct path?