Question: What will be the output? string result = ; string input = 2 6 1 8 3 5 ; int i

What will be the output?
string result ="";
string input ="261835";
int i =0;
do {
switch (input[i]){
case '1':
result +="a";
break;
case '2':
result +="b";
break;
case '3':
result +="c";
break;
case '4':
result +="d";
case '5':
result +="e";
result +="f";
case '0':
break;
default:
result +="x";
}
i++;
}while (input[i]!='\0');
cout <<result <<endl;

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 Programming Questions!