integer values A to Z [upper case]

Bjarne Stroustrup “Programming Principles and Practice Using C++”
Chapter 4 Try This page 113
Using std_lib_facilities.h by Bjarne Stroustrup.

//	Philipp Siedler
//	Bjarne Stroustrup's PP
//	Chapter 4 Try This page 113

#include "std_lib_facilities.h"

int main()
{
	for (char character = 'A'; character != 'Z' + 1; character++)
	{
		int integer = character;
		cout << character << '\t' << integer << '\n';
	}
	keep_window_open();
}
Output:
A       65
B       66
C       67
D       68
E       69
F       70
G       71
H       72
I       73
J       74
K       75
L       76
M       77
N       78
O       79
P       80
Q       81
R       82
S       83
T       84
U       85
V       86
W       87
X       88
Y       89
Z       90
Please enter a character to exit

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.