Question

In javaScript, after executing Var z = 0; var i
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Ans: a. 10

var z = 0;
var i = 0;

do{
   z = z+i;
i = i+1;
  
}while(i < 5);

z = 0 + 1 + 2 + 3 + 4 = 10

Add a comment
Know the answer?
Add Answer to:
In javaScript, after executing Var z = 0; var i = 0; do {z = z...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Given the following JavaScript code, what will be displayed on the web page? var k=1; var...

    Given the following JavaScript code, what will be displayed on the web page? var k=1; var m=0; var p=0; while (k<=4) {      k++;      for (p=1; p<=4; p++)      {            document.write(p +" ");      }      document.write("<br>"); }

  • Given the following JavaScript code, what will be displayed on the web page? var pho =...

    Given the following JavaScript code, what will be displayed on the web page? var pho = new Array(); for (var i = 0; i< 7; i++) {      pho[i] = (i*i) + 3; }            for (var i = 0; i< 7; i++) {      document.write(i + " => " + pho[i] + "<br>"); } 1 => 4 2 => 7 3 => 12 4 => 19 5 => 28 6 => 39

  • Given the following JavaScript code, what will be displayed on the web page? var i, j;...

    Given the following JavaScript code, what will be displayed on the web page? var i, j; for (i=1; i<=3; i++) {      for (j=2; j<=5; j++)      {            document.write(i+ "," + j + "; ");      }      document.write("<br>"); } 2,3; 3,4; 4,5; 4,6;

  • Consider the following JavaScript skeletal program: //the main program var x: function sub1 () { var...

    Consider the following JavaScript skeletal program: //the main program var x: function sub1 () { var x: function sub2 () { } } function sub3 () { } Assume the execution of this program is in the following unit order: main calls sub1 sub1 calls sub2 sub2 calls sub3 a. Assuming static scoping, which declaration of x is the correct one for a reference to x in: i. sub1 ii. sub2 iii. sub3 b. Repeat part a, but assume dynamic...

  • Given the following JavaScript code, what will be displayed on the web page? var x =...

    Given the following JavaScript code, what will be displayed on the web page? var x = 5; var y = 12; while (x < y) {      document.write(x);      document.write("<br>");      x=x+3; }

  • X and z are independent. Var(x)=1 ; Var(z) = sigma ^2. E(z)= 0 and y= ax+b+z...

    X and z are independent. Var(x)=1 ; Var(z) = sigma ^2. E(z)= 0 and y= ax+b+z I) cov(x,y)= ? ii) corr(x,y)=? dependent Varvane 2.

  • How can I this to jquery instead of it being javascript? function showMssg() { var message...

    How can I this to jquery instead of it being javascript? function showMssg() { var message = document.getElementsByTagName('pre')[0]; var console = document.getElementById('console'); if (message.style.display == 'block') { log += ' The log is now hidden. '; message.style.display = 'none'; console.innerHTML = 'Show Console Log'; } else { log += ' The log is now visible. '; message.innerHTML = log; message.style.display = 'block'; console.innerHTML = 'Hide Console Log'; } }

  • 1. What is the correct way to write a JavaScript array? var colors = (1:"red", 2:"green",...

    1. What is the correct way to write a JavaScript array? var colors = (1:"red", 2:"green", 3:"blue") var colors = ["red", "green", "blue"] var colors = 1 = ("red"), 2 = ("green"), 3 = ("blue") var colors = "red", "green", "blue" 2. Which event occurs when the user clicks on an HTML element? onclick onmouseover onchange onmouseclick 3. How do you declare a JavaScript variable? v carName; var carName; variable carName; 4. Javascript is A client-side scripting language that is...

  • I have this module of javascript var data = [     {id: 1, firstName: 'John', lastName: 'Smith'},...

    I have this module of javascript var data = [     {id: 1, firstName: 'John', lastName: 'Smith'},     {id: 2, firstName: 'Jane', lastName: 'Smith'},     {id: 3, firstName: 'John', lastName: 'Doe'} ]; module.exports.setid =     function (value) {         data.id = value; }; module.exports.getid = function () {         return data.id;     }; module.exports.setFirstName = function (value) {         data.firstName = value;     }; module.exports.getFirstName = function () {         return data.firstName;     }; module.exports.setLastName = function (value) {         data.lastName = value;     }; I wrote the following to get all first...

  • Consider the following program, written in JavaScript-like syntax: // main program var x, y, z; function...

    Consider the following program, written in JavaScript-like syntax: // main program var x, y, z; function sub1() { var a, y, z; . . . } function sub2() { var a, b, z; . . . } function sub3() { var a, x, w; . . . } Given the following calling sequences and assuming that dynamic scoping is used, what variables are visible during execution of the last subprogram activated? Include with each visible variable the name of the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT