jeudi 22 février 2018

Alphabetical order (Visual studio 13)

I'm struggling with this problem for 2 hours now . I try to make a program that will show letters in alphabetical order from a to z and the number suitable for every letter . Here is my code :

int main(){
int i = 97; //starting point
int v = 0; //increment with this value
while (i<=122)
{
    cout << char('a' + v) << "\t" << i << endl;
    ++i;
    ++v;
}

Now the problem is that is showing only numbers from 100 to 122 and anything i tried , doesn't shows 97 , 98 , and 99 .. Have you guys faced with this problem and can you help me ?

Aucun commentaire:

Enregistrer un commentaire