Question

SQU Portal Attendance English (en) 124 What is the output of the following program? int X, Y; 30; if (X >= 5) X = { { Y = X++
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer: Y = 61, X = 36

if(X >=5) // 30 >= 5 TRUE
{
Y = X++ + X; // X++ assigns fist and then increment 30 + 31 => Y = 61
X = X + 5; // X = X+5 = 31 + 5 = 36
}

It will enter if statement since condition is true.

X++ => X is first 30 and then increments by 1, X becomes 31

(X++) + X = 30 + 31 = 61

Thus Y is 61. X is currently 31

X = X + 5 = 31 + 5 = 36

X becomes 36.

Add a comment
Know the answer?
Add Answer to:
SQU Portal Attendance English (en) 124 What is the output of the following program? int X,...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Credisyu.euu.omym quiz/attempt E-LEARNING SERVICES SQU LIBRARIES SQU PORTAL ATTENDANCE ENGLISH (EN) QUESTION 21 Not yet answered...

    Credisyu.euu.omym quiz/attempt E-LEARNING SERVICES SQU LIBRARIES SQU PORTAL ATTENDANCE ENGLISH (EN) QUESTION 21 Not yet answered If you are working with a Kangaroo species in which each somatic cell contains 16 chromosomes. How many sister chromatids are present in the early telophase of mitosis? Marked out of 1.00 P Flag question Select one: aO b. 8 c. 64 d. 16 e. 32 elearn.squ.edu.om/mod/quiz/atte E-LEARNING SERVICES V SQU LIBRARIES SQU PORTAL ATTENDANCE ENGLISH (EN) QUESTION 23 One of the following is...

  • MATH2107 Calculus I Sp. E-learning services - SQU Libraries - SQU Portal Attendance English (en) MATH2107-Calculus...

    MATH2107 Calculus I Sp. E-learning services - SQU Libraries - SQU Portal Attendance English (en) MATH2107-Calculus I Spring20 Question 10 Not yet answered if the line 5x - y - 7 is tangent to the graph of y = f(x) at x - 1. Then f (1) + S (1) is Marked out of 2.00 Select one: A. None of these P log question B.9 ooo D.3 E.5 Previous page Data retention summary Get the mobile app

  • 107-Calculus I Sp.. E-learning services - SQU Libraries SQU Portal Attendance English (en) - H2107-Calculus I...

    107-Calculus I Sp.. E-learning services - SQU Libraries SQU Portal Attendance English (en) - H2107-Calculus I Spring20 If y=sin(tan(sin 70x)), then y' (2) is wered Select one: of 200 O AT estion B.2 TT C.- 27 D. TI E. None of these us page Data retention summary

  • mics | Spring20 E-learning services SQU Libraries - SQU Portal Attendance English (en) Fonics-Il Spring 20...

    mics | Spring20 E-learning services SQU Libraries - SQU Portal Attendance English (en) Fonics-Il Spring 20 Two identical amplifiers are cascaded. The overall bandwidth of the multistage amplifier is individual stage. the bandwidth of each ut of Select one: O A. less than B. equal to C. less than or equal to D. greater than O Next page us page P3 E

  • JIH HID E-learning services SQU Libraries - SQU Portal Attendance English (en) - LGEBRA AND MUTIVARIATE...

    JIH HID E-learning services SQU Libraries - SQU Portal Attendance English (en) - LGEBRA AND MUTIVARIATE CALCULUS FOR ENGINEEF Let Rix’sys 4 be the closed region having boundary C with counter-clockwise orientation. F = [xcosh4y, x?sinh4y). Using Green's theorem, evaluate the line integral dr and answer the follo questions. 1. Choose the equation that relates the line integral over C to the double integral over the region R in the Green's theorem: OF OF 2 ay OF 2 axdy R...

  • cmid=503355 LARIES SQU PORTAL ATTENDANCE ENGLISH (EN) 3. In a given dilution, the volume of the...

    cmid=503355 LARIES SQU PORTAL ATTENDANCE ENGLISH (EN) 3. In a given dilution, the volume of the solution increases from 10.00 mL to 50.00 mL. We can conclude that: 1. If the molarity of the final solution is 0.004500 M, the molarity of the original solution is 0.02250 M II. The dilution factor is 5 III. The molarity of 20.00 mL of the final solution is 0.001800 M Select one O a. 11 b. II, 111 c. 1, 11, 111 O...

  • What does the following code output? int x = 7, y = 10; X -= 30;...

    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;

  • QUESTION 1 What is the output of the following code snippet? int main() { bool attendance...

    QUESTION 1 What is the output of the following code snippet? int main() { bool attendance = false; string str = "Unknown"; attendance = !(attendance); if (!attendance) { str = "False"; } if (attendance) { attendance = false; } if (attendance) { str = "True"; } else { str = "Maybe"; } cout << str << endl; return 0; } False True Unknown Maybe QUESTION 2 What is the output of the following code snippet? #include <iostream> #include <string> using...

  • 11.3 What is the correct output from the following program? int A, B; A = 6;...

    11.3 What is the correct output from the following program? int A, B; A = 6; B = 1; if (A > B) { A = B + A * 2; B ++; } else { A = A % 2; B = B + 4; } cout << "A = << A << "B = " << B; Select one 0 2 A=8B-2 O b. A=B=5 c None of the above is correct d A-13 B= 2

  • PLEASE SOLVE THESE QUESTIONS Q.3.6 What does the following code output? int x = 8; int...

    PLEASE SOLVE THESE QUESTIONS Q.3.6 What does the following code output? int x = 8; int y = 2; while(x > 8) { X- y+=2; } System.out.println(y); Q.3.7 What does the following code output? System.out.println((2 + 3 - 5) * (3/3) + (5+5)); Q.3.8 What does the following code output? if((2 == 2) && (3 != 3) && ((5 + 1)==6){ System.out.println(true); else { System.out.println(false);

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT