Computer Science, asked by amisha9698, 3 months ago

I want this Q. to we done plss​

Attachments:

Answers

Answered by allysia
2

Answer:

dDESER@3136

Explanation:

Step wise:

Word= Desert#2025

  • m=''(empty string)
  • As per the loop D is lowered to 'd' and added to empty string m. (m='d'
  • e is lower so the previous letter is capitalized and added to m. (m='dD')
  • Same a previous step but since the previous letter here is E (before S)  m='dDE'
  • m='dDES'
  • m='dDESE'
  • m='dDESER'
  • Now the element here is not a letter or number so it triggers else statement m='dDESER@'
  • The number is increased by 10 then appended to the string m='dDESER@3'
  • m='dDESER@31'
  • m='dDESER@313'
  • m='dDESER@3136'

Loop ends here and since m='dDESER@3136' was the last value it's printed.

Similar questions