They are both equallyequal - the same According.
According to the specsspecifications anything that is not 0 is considered true, so even without any optimization, and a good compiler will not generate any code for for while(1) or while(2) the. The compiler would generate a simple check for != 0!= 0.