Characters and Codes

Lab C++ Beginner 10 points

Read a character. Print its ASCII code, the next character, and whether it is a digit (yes/no).

Input

One character.

Output

Three lines.

Example

Input

A

Output

65
B
no
Sample input available Sample output available
Editor
C++

Hints

Printing a char shows the character; cast to int to see its code.

Solution explanation

c + 1 is an int, so cast it back to char to print a character.

Show solution
#include <iostream>
#include <cctype>
using namespace std;

int main() {
    char c;
    cin >> c;
    cout << static_cast<int>(c) << "\n";
    cout << static_cast<char>(c + 1) << "\n";
    cout << (isdigit(c) ? "yes" : "no") << "\n";
    return 0;
}
Output
Answer
HOME LEARN COMMUNITY DASHBOARD