Characters

Lab C Beginner 10 points

Store 'A' in a char. Print it with %c, its ASCII code with %d, and the character 5 places later.

Input

None.

Output

Three lines.

Example

Output

A
65
F
Sample output available
Editor
C

Hints

A char is a small integer; %c shows it as a character, %d as a number.

Solution explanation

Characters are stored as numbers (ASCII codes), so you can do arithmetic with them.

Show solution
#include <stdio.h>

int main() {
    char c = 'A';
    printf("%c\n", c);
    printf("%d\n", c);
    printf("%c\n", c + 5);
    return 0;
}
Output
Answer
HOME LEARN COMMUNITY DASHBOARD