Find Hundredth Digit

The program must accept an integer N as the input. The program must print the hundredth digit of N as the output.

Boundary Condition(s):
100 <= N <= 10^9

Example Input/Output:
Input:
8962

Output:
9

#include<stdio.h>
int main()
{
    int N;
    scanf("%d", &N);
    printf("%d", (N % 1000) / 100);
    return 0;
}
Previous Article

Function getColumn

Next Article

Print YES or NO (Using Logical AND)

Write a Comment

Leave a Comment

Your email address will not be published. Required fields are marked *