Java: Changing loop counter value inside the loop -


इस सवाल का पहले से ही एक उत्तर है: < / P>

  • 6 जवाब

    अगर मेरे पास एक पाश है किसी भी लूप) .. अब के लिए लूप को कह देता है:

      के लिए (int x = 0; x & lt; 100; x ++)   

    यदि, लूप के पुनरावृत्त के भीतर, मैं कहता हूं:

      x = 50;   

    क्या लूप की अगली पुनरावृत्ति 50 से जुड़ी होगी? या लूप के भीतर x के मान में कोई परिवर्तन लूप काउंटर को प्रभावित नहीं करता है?

    के लिए फिर से लिखना डू-ऑल लूप के रूप में नीचे लूप

      के लिए (int x = 0; x & lt; 100; x ++) cout & lt; & lt; एक्स एंड एलटी; & lt; ""; int x = 0; करना {cout & lt; & lt; एक्स एंड एलटी; & lt; ""; एक्स ++; } जबकि (x & lt; 100);   

    50 के लिए समान

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -