← Back to Basic I/O

12. ASCII to Character

Easy

Problem Statement

Accept an integer value and print the corresponding character associated with the integer value.

Input Format

Integer value indicating the ASCII value to be evaluated

Output Format

Given integer:Corresponding character

Constraints

0 <= ch <= 127
Sample Input 1:
65
Sample Output 1:
65:A
Sample Input 2:
100
Sample Output 2:
100:d
C++
#include <iostream>

using namespace std;

int main() {
  int a;
  cin >> a;
  char ch = a;
  cout << a << ":" << ch;
  return 0;
}