Question

Can someone please explain this in steps? 2. Determine the output k = 4 m =...

Can someone please explain this in steps?

2. Determine the output

k = 4

m = 0

n = 7

While j < k

m = 5

While m < n

Ouput “X”

m = m + 1

Endwhile

j = j + 1

Endwhile

Output j, k, m, n

Homework Answers

Answer #1

// initialization of varibles

// here k= 4, m =0, n = 7

k = 4

m = 0

n = 7

// iterating the loop untill j is less than k.

// j must be smaller than 4

While j < k

// value of m becomes 5 after the loop

m = 5

// here iteration of loop is untill m is less than n

// here n = 7

While m < n

// print X

Ouput “X”

// increment the value of m by 1

m = m + 1

// first while loop will be ended

Endwhile

// increment the value of j by 1

j = j + 1

// end of second while loop

Endwhile

// print the value of j k m n

Output j, k, m, n

--------------------------------------------------------------------------------------------

NOTE: The given code will give error because j variable is not initialized,.

PLEASE LET ME KNOW IF YOU WANT MORE INFO.

PLEASE UPVOTE

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
Can someone please explain this 1. Determine the output a = 3 b = 4 c...
Can someone please explain this 1. Determine the output a = 3 b = 4 c = 10 While a < c       a = a + 2       b = b * 2 Endwhile Output a, b, c 2. Determine the output k = 4 m = 0 n = 7 While j < k m = 5 While m < n Ouput “X” m = m + 1 Endwhile j = j + 1 Endwhile Output j, k,...
Show all the steps and explain. Don't skip steps and please clear hand written f(x)=x^m sin(1/x^n)...
Show all the steps and explain. Don't skip steps and please clear hand written f(x)=x^m sin(1/x^n) if x is not equal 0 and f(x)=0 if x =0 (a) prove that when m>1+n, then the derivative of f is continuous at 0 limit x to 0 x^n sin(1/x^n) does not exist? but why??? please explain it should be 0*sin(1/x^n)
2. Write the output matrix “v” t = [2:4]; k = [1:3]; v = t.*k –...
2. Write the output matrix “v” t = [2:4]; k = [1:3]; v = t.*k – k.^2 4. Given: D = [1 2 3 4 5 6 7 8 9] (3x3) . Which command will extract the submatrix [1 2 3 4 5 6] (2x3) ? a. D[1:2,1:3] b. D(1,2 ;1,3) c. [D(1:2),D(1:3)] d. D(1:2,1:3) 14. What will be the dimension of matrix B? B=[ones(3) zeros(3) rand(3); 2*eye(9)] 18. Find the value of “C” A=1:2:10; B=linspace(1,5,5); C = length(A)*B(2)+A(5)*B(3); 19....
could someone please explain this code and the output to me? #include <stdio.h> #include <unistd.h> int...
could someone please explain this code and the output to me? #include <stdio.h> #include <unistd.h> int main(void) { printf("one\n"); fork(); printf("two\n"); return 0; }
1.Planes x = 0 and x = 4 carry current K = -10 ̂az A/m and...
1.Planes x = 0 and x = 4 carry current K = -10 ̂az A/m and K = 10 az A/m, respectively. Determine H at (a) (1, 1, 1) (b) (0, - 3, 10)               (c) (-1, -1, -1) (d) (7, 1, 0)   2.. A current distribution gives rise to the vector magnetic potential          A = Z2Yax+X2Y2Z2ay-8XYZ2az Wb/m. Calculate (a) B at (1, -2, 5) (b) The flux through the surface defined by x = 1, 0 <= y<= 5,      0...
Given the following sample data from experiments, determine the orders m and n. Rate= k [Bleach]m...
Given the following sample data from experiments, determine the orders m and n. Rate= k [Bleach]m [Dye]n Run [Bleach] M [Dye] M Rate (M/s) 1 .08000 .04000 22.4 x 10-3 2 .06500 .02000 3.00 x 10-3 3 .02200 .04000 0.466 x 10-3 4 .08000 .02000 5.60 x 10-3 5 .04000 .04000 2.80 x 10-3 m = 0 and n = 1 m = 1 and n = 2 m = 2 and n = 3 m = 3 and n...
can someone edit my c++ code where it will output to a file. I am currently...
can someone edit my c++ code where it will output to a file. I am currently using xcode. #include <iostream> #include <cctype> #include <cstring> #include <fstream> using namespace std; bool inputNum(int [],int&,istream&); void multiply(int[],int,int[],int,int[],int&); void print(int[],int,int,int); int main() {ifstream input; int num1[35],num2[35],len1,len2,num3[60],len3=10,i; input.open("multiplyV2.txt"); //open file if(input.fail()) //is it ok? { cout<<"file did not open please check it\n"; system("pause"); return 1; }    while(inputNum(num1,len1,input)) {inputNum(num2,len2,input); multiply(num1,len1,num2,len2,num3,len3); print(num1,len1,len3,1); print(num2,len2,len3,2); for(i=0;i<len3;i++) cout<<"-"; cout<<endl; print(num3,len3,len3,1); //cout<<len1<<" "<<len2<<" "<<len3<<endl; cout<<endl;    } system("pause"); } void...
c.) Determine whether the seriesX∞ k=1 k(k^4 + 2k)/(3k 2 − 7k^5) is convergent or divergent....
c.) Determine whether the seriesX∞ k=1 k(k^4 + 2k)/(3k 2 − 7k^5) is convergent or divergent. If it is convergent, find the sum. d.) Determine whether the series X∞ n=1 n^2/(n^3 + 1) is convergent or divergent.
please show steps by steps so i can understand f (x) = (1/4)x^4-24x^2+1 (a) Find all...
please show steps by steps so i can understand f (x) = (1/4)x^4-24x^2+1 (a) Find all the open intervals on which f increases/decreases, and determine the relative extrema of f . (b) Find all the open intervals on which f is concave up (down). Then determine the x- coordinates of all inflection points of f . Provide details with step by step to justify your answers!
please show steps by steps so i can understand f (x) = (1/4)x^4-24x^2+1 (a) Find all...
please show steps by steps so i can understand f (x) = (1/4)x^4-24x^2+1 (a) Find all the open intervals on which f increases/decreases, and determine the relative extrema of f . (b) Find all the open intervals on which f is concave up (down). Then determine the x- coordinates of all inflection points of f . Provide details with step by step to justify your answers!
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT