Q:

Write C++ program to print ASCII value of all Uppercase Alphabet

0

Write C++ program to print ASCII value of all Uppercase Alphabet

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

I have used CodeBlocks compiler for debugging purpose. But you can use any C++ programming language compiler as per your availability.

#include <iostream>
using namespace std;
 
int main()
{
    char c;
 
    // Printing ASCII value of all Uppercase Alphabet
    for(c = 'A'; c <= 'Z'; c++){
       cout << "ASCII value of: " << c << " = " << (int)c <<endl;
    }
    return 0;
}

Result:

ASCII value of: A = 65

ASCII value of: B = 66

ASCII value of: C = 67

ASCII value of: D = 68

ASCII value of: E = 69

ASCII value of: F = 70

ASCII value of: G = 71

ASCII value of: H = 72

ASCII value of: I = 73

ASCII value of: J = 74

ASCII value of: K = 75

ASCII value of: L = 76

ASCII value of: M = 77

ASCII value of: N = 78

ASCII value of: O = 79

ASCII value of: P = 80

ASCII value of: Q = 81

ASCII value of: R = 82

ASCII value of: S = 83

ASCII value of: T = 84

ASCII value of: U = 85

ASCII value of: V = 86

ASCII value of: W = 87

ASCII value of: X = 88

ASCII value of: Y = 89

ASCII value of: Z = 90

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
Write C++ program to print multiplication table of... >>
<< Write C++ program to print alphabets from a to z...