lundi 21 mars 2016

what does this java program do

I cant figure out what does this java program do. It gives 31 and 12. Thanks in advance ! Regards

int x = 911; 
int y= 29;           
int z = 0;                        

if (x>=0) {                       
    if (y>=1) {                   
        while (y<=x) {            
            x = x - y;            
            z = z + 1;               
        }   
        System.out.println(z);
        System.out.println(x);                                         
    }
}                            

Aucun commentaire:

Enregistrer un commentaire