Menu
Coddy logo textTech

Middle digit

Lesson 6 of 32 in Coddy's Coding Problems course.

Create a program where you will find the middle digit in a three digit number.

 

challenge icon

Challenge

Easy

Write a program that gets a natural number N from input and outputs its middle digit to the screen.

For example, the middle digit of the number 123 is 2, the middle digit of the number 987 is 8.

 

Input

123

Output

2

Input
987

Output
8

Try it yourself

#include <stdio.h>

int main() {
    // Write code here
    return 0;
}

All lessons in Coding Problems