## Midterm Practice Problems

# Midterm Practice Problems

Copyright © 2014 Bart Massey

These sample problems are maybe slightly harder than the problem that will appear on the actual midterm. Enjoy!

**Reverse:**Input a string. Print that string in reverse order. For example:`? Hello! !olleH`

**Palindrome Check:**Input a string. Print "yes" if that string is a "palindrome" (reads exactly the same backwards and forward). The palindrome must be exact, including spaces and capitalization. For example:`? AMANAPLANACANALPANAMA yes`

but

`? ABLEWASIEREISAWELBOW no`

**Digit Sum:**Find the smallest positive integer whose digits add up to 23. The second smallest positive integer whose digits add up to 23 is 689.**Digit Product:**Find the smallest positive integer whose digits multiply together to yield 567. The second smallest such number is 979.Solve the first two problems at http://projecteuler.net.