QUESTION 1: Write a Python function called middle digit () that reads as keyboard input a positive three-digit integer n. The function returns an integer which is the middle digit of n. So if n = 123 then the function returns 2. It is not allowed to use strings in this function. Use modulo and whole division to determine the number.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter7: User-defined Simple Data Types, Namespaces, And The String Type
Section: Chapter Questions
Problem 8PE: Write a program that reads in a line consisting of a students name, Social Security number, user ID,...
icon
Related questions
Question

QUESTION 1: Write a Python function called middle digit () that reads as keyboard input a positive three-digit integer n. The function returns an integer which is the middle digit of n. So if n = 123 then the function returns 2. It is not allowed to use strings in this function. Use modulo and whole division to determine the number.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning