Sorry, I really do not have idea on how to make the uppercase and lowercase be identified as one variable type. For example a == A . I don't have any background idea on ASCII but I have made this code that would show how many times an alphanumeric character may appear in a sentence of only 25 characters in maximum.
//my codes
#include <iostream>
#include <string>
using namespace std;
cout <<"Enter a sentence : " <<endl;
getline (cin, sentence);
cout<<"Which letter would like to count the number it times appears: "<<endl;
cin>>searching;
for (int i=0; i<sentence.length(); i++)
{
if (sentence [i]== searching)
{
counter++;
}
}
cout<<"the letter '" <<searching << "' appears " << counter << " times "<< endl;