samedi 23 février 2019

checking the ASCII value of different charcacters (c#)

I need to make a program which gets an random char and checks his ASCII value (int).

for example:

Console.WriteLine("Please enter your first character");

char num1 = int.char(Console.ReadLine());

if((character) >= 65 && (character) <= 90 && (character) >= 97 && (character) <= 122)

{

letters += 1;

}

(this program checks the value like it is a number and if I enter the letter F for example it wont add 1 to the letters counter)

Aucun commentaire:

Enregistrer un commentaire