please check my code. i have wriitrn the code according to the video given but its not giving correct output
Code output wrong
@Aparna
You did a mistake while taking inputs. The cin>> take space-separated string input. To take a whole line as the input you need to use getline(cin,s1); . Then your code will work fine.
ohh right!! thanks a lot 