Passing only three test cases

quest link-https://online.codingblocks.com/player/16974/content/4806
code link-https://ide.codingblocks.com/s/68954
what 's wrong in my code?
acc to question if i type any other character then it is supposed to repeat the whole opeartion,but for how many times.

@shubhamshagy hey Shubham instead of using so much decision control use only one while loop inside while loop take a switch case which takes input as a character and this character decide which case will execute case like +,*/,- and take a default case : cout<<“Invalid operation. Try again.”
note this loop will run until you hit character like X or x
eg

cin>>ch;
while(ch!=‘x’&&ch!=‘X’)
{
switch(ch){
case ‘+’: {

         break;
    }
    
    case '-': {
       
         break;
    }
   
    case '*':  {
        
         break;
    }
   
    case '/':  {
     
        break;
    }
    
    default :  cout<<"Invalid operation. Try again."<<endl;
    break;
     }
     cin>>ch;

}
}
I hope you will get my point :smile:

but switch is not taught yet…

@shubhamshagy I discussed the easy version with you just take input in between and you are done
switch work based upon input given we are given character based upon the character the case will execute if character is non of these cases the default will work you don’t have to write all possible character

code link-https://ide.codingblocks.com/s/69013
still showing test cases failed

@shubhamshagy on line no 21 you didn’t output your result and put endl in each output line in default also

code-https://ide.codingblocks.com/s/69019
still showing test cases failed…??

@shubhamshagy hey shubham your output should match with sample one so correct line no 22 endl and
put dot on default output line "Invalid operation. Try again"as “Invalid operation. Try again.”

Hey Shubham,
As you are not responding to this thread, I am marking your doubt as Resolved for now. Re-open it if required.

Please mark your doubts as resolved in your course’s “ Ask Doubt ” section, when your doubt is resolved.