ASCII
ASCII
#include <iostream>
int main() {
char ch;
cout << "The ASCII value of '" << ch << "' is " << int(ch) << endl;
return 0;
This code takes a character input and prints its ASCII value using int(ch).
#include <iostream>
int main() {
char ch;
// Convert to uppercase
// Convert to lowercase
} else {
return 0;
#include <iostream>
int main() {
return 0;
This code creates a pattern of characters from the ASCII range 'A' to 'Z'
and wraps around using modulo arithmetic.
#include <iostream>
int main() {
char ch;
else if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')) {
else {
return 0;
}
This code uses ASCII values to check if the character entered is a digit,
letter, or special character.
#include <iostream>
int main() {
for (int i = 65; i <= 90; i++) { // ASCII values from 'A' to 'Z'
for (int i = 97; i <= 122; i++) { // ASCII values from 'a' to 'z'
return 0;
Good luck with your exam! Let me know if you need anything else.