C C++ program to find ASCII value of a character

C C++ program to find ASCII value of a character

If statement और decision making statements के बारे में अधिक जानने के लिए देखें— If statements in C

Looping और iterative statements के बारे में और अधिक जानने के लिए देखें— Looping statements in C

विभिन्न प्रकार के Computer Coding Systems जैसे—BCD, ASCII, EBCDIC आदि के बारे में अधिक जानने के लिए देखें—Computer Coding Systems

C program to find ASCII value of a character

#include<stdio.h>
int main()
{
    char ch;
    int val;
    printf("Enter a character: ");
    scanf("%c",&ch);
    val=ch;
    printf("ASCII value = %d",val);
    return 0;
}

C++ program to find ASCII value of a character

#include<iostream>
using namespace std;
int main()
{
    char ch;
    int val;
    cout<<"Enter a character: ";
    cin>>ch;
    val=ch;
    cout<<"ASCII value = "<<val;
    return 0;
}

Output of C C++ program to find ASCII value of a character

ASCII Value of a Character C C++ Program Output

Similar ASCII table programs in C C++

  1. Convert lowercase to uppercase
  2. Convert uppercase to lowercase
  3. Print complete ASCII table
Share it to:

Published by

admin

I am a computer teacher, programmer and web developer