Question
What is the output of the following codes, consider each case independently, create a table such that it has three columns: I, J and X.
What is the output of the following codes, consider each case independently, create a table such that it has three columns: I, J and X. Display in each row the value of X for different values of I and J. See below sample for the following #2 code, note that X is initialized the before starting the For-Loop. Once Loop starts, X values are carried forward from loops execution. In table below, bold 0 from first row is carried to the second row:
I | J | X |
1 | 1 | 0 * 1 * 1 = 0 |
1 | 2 | 0 * 1 * 2 = 0 |
And continue for other values of I and J |
|
|
What will be the value of x after the following loop is executed:
x = 0
For i = 1 To 2
For j = 1 To 3
x = x * i * j
Next j
Next i
What will be the value of x after the following loop is executed:
x = 1
For i = 1 To 2
For j = 1 To 3
x = x * i * j
Next j
Next i
What will be the value of x after the following loop is executed:
x = 0
For i = 1 To 2
For j = 1 To 3
x = x * i + j
Next j
Next i
What will be the value of x after the following loop is executed:
x = 0
For i = 1 To 2
For j = 1 To 3
x = x + i * j
Next j
Next i
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started