Question

var i = 28; if ( i / 2 % 2 > 0 ) { document.write("The...

var i = 28;
if ( i / 2 % 2 > 0 ) {
document.write("The number is an odd integer");
}
else {
document.write("The number is an even integer");
}

What is displayed when the code segment above is executed?

a.Nothing is printed. The result of the computation is equal to 0.

b..The number is an odd integer.

c.Nothing is printed. There is a runtime error.

d.The number is an even integer.

Homework Answers

Answer #1

SOLUTION -

Correct answer is "(d) The number is an even integer. "

First given i = 28 s0,

if( 28/2 = 14 % 2 = 0 > 0 ) it false so it will print else part .

IF YOU HAVE ANY DOUBT PLEASE COMMENT DOWN BELOW I WILL SOLVE IT FOR YOU:)
----------------PLEASE RATE THE ANSWER-----------THANK YOU!!!!!!!!----------

Know the answer?
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
Similar Questions
1. int numDash=(5 + 8) / 2; for (i=0; i<numDash; i++)    cout<<"-"; How many dashes...
1. int numDash=(5 + 8) / 2; for (i=0; i<numDash; i++)    cout<<"-"; How many dashes will be printed out from the above code? 2. Calculate a test average in a variable named avg and then print it out. The variable avg when printed should have two numbers to the right of the decimal point. (example - 98.56) The average is calculated by using integer division. Divide an integer variable named earned by an integer variable named max, and then...
2.) In order to have a loop that allows the user to input 10 values, what...
2.) In order to have a loop that allows the user to input 10 values, what would be entered in the blank below: int counter = _________; while (counter < 10) { inputVal = Console.ReadLine(); ++counter; } 3.)What is produced from the following code segment? for (int i = 1; i < 5; i++) WriteLine(i); Nothing is displayed Outputs 5 thru 9 Outputs 10 Outputs 1 thru 4 Outputs 1 thru 5 Outputs 10 thru 14 Outputs 0 thru 4...
a modified roulette wheel has 28 slots. one slot is 0,another is00, and the others are...
a modified roulette wheel has 28 slots. one slot is 0,another is00, and the others are numbered 1 through 26. you are placing a bet that the outcome is an odd number. (in roulette, 0 and 00 are neither odd nor even) a. what is your probability of winning? b. what are the actual odds against winning? c. when you bet that the outcome is an odd number, the payoff odds are 1:1. how much profit do you make if...
So I am trying to write a factor generator. User provides an integer and program needs...
So I am trying to write a factor generator. User provides an integer and program needs to return all factors. I have found an example the code that does this function, but I can't understand how it does that. Please explain line by line how this works.     System.out.print("Enter an integer: ");        int number = input.nextInt();        int index = 2; //Prompts user for an integer and assigns it to variable number, and integer index is declared...
A modified roulette wheel has 28 slots. One slot is​ 0, another is​ 00, and the...
A modified roulette wheel has 28 slots. One slot is​ 0, another is​ 00, and the others are numbered 1 through 26, respectively. You are placing a bet that the outcome is an eveneven number.​ (In roulette, 0 and 00 are neither odd nor​ even.) a. What is your probability of​ winning? The probability of winning is nothing. ​(Type an integer or a simplified​ fraction.) b. What are the actual odds against​ winning? The actual odds against winning are nothing​:nothing....
public int linearSearch2(ArrayList<Integer> pList, Integer pKey) { for (int i = 0; i <= pList.size() /...
public int linearSearch2(ArrayList<Integer> pList, Integer pKey) { for (int i = 0; i <= pList.size() / 2; ++i) { if (pList.get(i).equals(pKey)) { return i; } else if (pList.get(pList.size() - 1 - i).equals(pKey)) { return pList.size() - 1 - i; } } return -1; } ----- Q1)Which function f(n) counts how many times the key operation(s) is(are) performed as a function of the list size n when pKey is not in pList (the worst case behavior of linearSearch2() occurs when pKey...
What error will Python display when it attempts to execute the following if/else statement? if a...
What error will Python display when it attempts to execute the following if/else statement? if a == b : print("Equal") else : print("Not Equal") if a > b : print("a is larger") else : print("b is larger") Python will display an error indicating that == should be replaced with = Python will display an error indicating that an if statement cannot reside inside the body of an else Python will display an error indicating that there is a problem with...
I need to write a c++ segment to calculate the phase angle of a complex number...
I need to write a c++ segment to calculate the phase angle of a complex number on the interval [0, 2pi). The segment needs to return -1 when the phase is undefined. I am having trouble figuring out how to adjust a number outside of the interval and get it into the interval (i.e. add 2pi, add pi, etc). This is what I have so far:    if (real == 0 && imag==0)    {        return -1;   ...
Answer the following questions: 1. Given the code segments below with n as the problem size,...
Answer the following questions: 1. Given the code segments below with n as the problem size, answer the following questions: //Code Segment 1 (Consider n as a power of 3) int sum = 0; for(int i = 1; i <= n; i = i*3) sum++;​​​​​​​// statement1 //Code Segment 2: (Consider both possibilities for x) if(x < 5){ for(int i = 1; i <= n; i++)    for(int k = 1; k <= i; k++)    sum++;​​​​​// statement2 } else{ for(int...
***Python Hailstones, also known as the Collatz sequence, are a mathematical curiosity. For any number in...
***Python Hailstones, also known as the Collatz sequence, are a mathematical curiosity. For any number in the sequence, the next number in the sequence is determined by two simple rules: If the current number n is odd, the next number in the sequence is equal to 3 * n + 1 If the current number n is even instead, the next number in the sequence is equal to one half of n (i.e., n divided by 2) We repeat this...