Pls correct my code
@devanshkapur changed the exiting condition and cin>>ch
dont forget to hit like and mark resolved if cleared 
thanks for the code but writing ch!=x in while condition will also work right if we made changes wrt that instead of while(true) ?
thanks for the code…but writing ch!=x in while condition would also work right? if we made changes wrt that instead of while(true) ?