/*
This is the second lab of Lab EE107
The purpose of this lab is to understand the convert alphanumeric to ascii code, and ascii code to alphanumeric
The purpose is to create the code and free of syntax and grammatical errors
Author: Ekwegbalum Unachukwu
Star ID:do2170dt
Date: Jan 30, 2024.
    */

#include <stdio.h>

int main() {
    //Converting integers to the ascii code
    int ascii_code_1_EU = 64;//ASCII code for '@'
    int ascii_code_2_EU = 93;//ASCII code for ']'
    int ascii_code_3_EU = 57;//ASCII code for '9'
    
    printf("the character with ASCII code %d is %c\n", ascii_code_1_EU, (char)ascii_code_1_EU);
    printf("the character with ASCII code %d is %c\n", ascii_code_2_EU, (char)ascii_code_2_EU);
    printf("the character with ASCII code %d is %c\n\n", ascii_code_3_EU, (char)ascii_code_3_EU);

    char ch1 = 'B',ch2 = ']',ch3 = '9';

    //Casting the character to an integer to get its ASCII value
    int asciiValue1_EU = (int)ch1, asciiValue2_EU = (int)ch2, asciiValue3_EU = (int)ch3;

    printf("the character with ASCII code %c is %d\n",ch1,asciiValue1_EU);
    printf("the character with ASCII code %c is %d\n",ch2,asciiValue2_EU);
    printf("the character with ASCII code %c is %d\n",ch3,asciiValue3_EU);
    
    
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: