mercredi 28 septembre 2016

Change last digit of a number

I'm learning C# and one of my assignments is to aks for a number, then ask for a single digit and let the program see if the single digit is the last digit of the previously given number (eg number 1647, last digit 7) Then the program has to display the original number but with the last digit either red if the digit given is incorrect, green if the digit entered is correct. So;

number: 1647 digit: 7 1647(7 is green)

number: 1647 digit: 3 1647(7 is red)

So how do I only get the last digit to change color?

Aucun commentaire:

Enregistrer un commentaire