The answer will be (b). -1-2
Because as the for loop will run for i= 1,2,3,4 and will keep incrementing respectively from 1 to 4.
And if the i get equals to 3 then it continues to the next block of statement .
So when i is =1 it prints-1
And after incrementation when i i becomes 2 , it printes -2
But when i becomes 3 then it continues to the another block of statement and doesn't print anything .
So the answer will be -1-2 .
ed What is the output after execution of the code block {for (int i=1;i<=4; i++) {if...
What is the output of the following code: int numbers [] {99,87,66,55,101}; cout << numbers[i] « " ";
What is the output of the following C++ code? int count = 1; int num = 25; while (count < 25) { num--; count++; } cout << count « " " « num << endl i 25 1 0 24 1 0 25 0 0 24 0 In this while loop statement, while (counter < 10), where counter is an int variable. Which statement below is an equivalent way to write this while statement? while (10 < counter) while (9...
What is the output?
What is the output of the following code? for(int i =0; i<3; i++) { int x = 0; x = x+i; Sy System.out.println(x);
Question 15 After the following code executes, what is the output if user enters 0? int x =-1; cout << "Enter O or 1:"; cin >> X; if (x) cout << true else cout << false O nothing will be displayed true O false 0
What is the output of the following code fragment? int i = 1; while( i <= 5 ) if(i == 2 || i == 4) System.out.println(i + ":" + " is an even index) System.out.println("i: " + i); i++;
QUESTION Z What is the output of the following code: int list[] = {1, 2, 3, 4, 5, 6}; for (int i = 1; i < 6; i++) list[i] = list[i - 1]; for (int i = 0; i < 6; i++) cout << list[i] << ""; 0 1 2 3 4 5 6 0 2345 61 0 111111 0 234 566
What does the following code output? int x = 7, y = 10; X -= 30; y *= 5; X += 32; y /= 4; cout << "y = " « y << " and x = " << x << "; " << endl; X -= 10; y /= 5; cout << "x = " << x < " and y = " << y « ";" << endl;
What is the output of the following? Start const int MEET-8 intj - 1 <MEET True False JIE MEET end True False cout <0 I coutea <MEET True False 1 > MEET end True False I couteco cout<< 0004567 234000 0123000 1234000 567000 Moving to another question will save this response
Question 28 What is the output of the following program? Assume code is correct. #include <iostream> using namespace std; int main() { int i = 1,j,x = 5, y = 4; while (i <= y) { for (j = 0; j <= y2; j++) cout << 'Z'; cout << endl; i=i+1; } return 0; 3 B IV AA-I E333 X X, B, GT 12pt Paragraph