MCQs > IT & Programming > JavaScript > What's the output? var main = function() { var i=2,j=0,k=0,m=1.5,s=0; while(i<=3) { j=1; while(j<=4) { k=1; while(k<=4) { if(k%2!==0) { s=s+i+j+m; k++; } else { k++; m++; } } j=j+2; m++; } i++; m++; } console.log(s); } main();

JavaScript MCQs

Find the output of the following JavaScript code.

var main = function() {
var i=2,j=0,k=0,m=1.5,s=0;
   while(i<=3)
   {
       j=1;
       while(j<=4)
       {
           k=1;
           while(k<=4)
           {
               if(k%2!==0)
               {
                   s=s+i+j+m;
                   k++;
               }
               else
               {
                   k++;
                   m++;
               }
           }
           j=j+2;
           m++;
       }
       i++;
       m++;
   }
   console.log(s);
}
main();


Answer

Correct Answer: 92

Explanation:

Note: This Question is unanswered, help us to find answer for this one

JavaScript Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

JavaScript Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it