Letter Position

Lab C Beginner 10 points

Read a lowercase letter and print its position in the alphabet (a = 1) and the upper-case letter.

Input

One lowercase letter.

Output

Two lines.

Example

Input

a

Output

1
A
Sample input available Sample output available
Editor
C

Hints

c - 'a' is 0 for a, 1 for b, ...

The space in " %c" skips any whitespace first.

Solution explanation

Letters have consecutive codes, so subtracting 'a' gives the position.

Show solution
#include <stdio.h>

int main() {
    char c;
    scanf(" %c", &c);
    printf("%d\n", c - 'a' + 1);
    printf("%c\n", c - 'a' + 'A');
    return 0;
}
Output
Answer
HOME LEARN COMMUNITY DASHBOARD