dimanche 16 août 2020

Why the variable 'i' is returning a value of 0 when even not initialized?

'''

void main()
{
 int i, n, count=0;
 printf("%d\n",i);
 printf("%d\n", n);

    while(count!=10)
    {
        printf("%d", i);
        i++;
        count++;
    }
}

'''

IF it is giving me some garbage value then how can be the same value be assigned to 'n' variable?

Aucun commentaire:

Enregistrer un commentaire