Between i = 0 to i = 100, there are 101 numbers.
Therefore, the loop will execute 101 times.
5.2 How many times this for loop will execute? for (i = 0; i <= 100;...
14.3 How many times is the statement cout<<]<<","<</<<","; executed in the following program? int I, ); for (I = 2; I >= 0; I--) { for (] = 1; }<2; J++) cout << ) << ", << I << cout << endl; 11 } Select one O 2.3 0 6.6 O c. 2 d. None of the above are correct
C++ 5.How many times will the following loop run? int i=5; while (i19) 6 . What is the output of the following code snippet? int time 1; int year2 int rate = 1; int principal = 5; int interest-0 cout <<i < endl while (year< 5) interest (principal * time rate) /1 ; cout << interest << endl; year++
How many Iterations will this while loop perform? int ico), j(10); cout << "i = " << i << endl; cout << "j = " << j << endl; while (i > j) { cout << "j-" « j << endl; j += 2; cout << "i = " << i << endl; } cout << "i = << i << endl; cout << "j = " << j << endl; 5 6 C 8 10 Infinite times Does the...
whats the answers For the following code, indicate how many times the loop body will execute for the following input values: 2 1 0? userNum - 3 while (userNum > 0) { // Do something // Get user um from input } 3 Given the following code, how many times will the inner loop body execute? int row: int col; for (row = 0; row < 2; row - row + 1) { for (col = 0; col < 3;...
In the code given below, how many times the cout statement is executed? for (int x = 0; x< 10; x++) for (int y=0; y < 10; y++) for (int z = 0; z <=10; z++) cout << X+y+z;
How many 'X's will be output? while (i <=3){ k=1: while (k <- i) { cout << "x"; cout << endl; ++i;)
II. SHORT ANSWER QUESTIONS. (10, 2 POINTS FOR EACH QUESTION) 1. What will the following loop display? int x = 0; while (x <5) cout<<x << endl;
Help! How do I fix these errors? /* This while loop continues to execute until the user chooses valid no. of minute*/ while (true) 56 57 58 59 /getting the input entered by the user cout << "Enter no. of minute cin > minutes; if (minutes >= 88 minutes <= 44640) 61 break 64 65 else 67 68 << endl; cout <<-.. Invalid· Must be between 0-44640 continue 70 71 72 73 74 75 76 //Based on the user choice...
3. How many times "hello" is get printed? for(int x=-1; x<=10; x++) { if(x < 5) continue; cout<<"hello"<<endl; }* (3 Points) 5 times 11 times Infinite times 6 times
fork(); for(i=0;i<5;i++) if(pid==0)fork(); How many child process are created?