Run the following code and display i and k k = 0; i = 0; while(k<1 && i <1) k = 0; i = i+1; i= i-k-1; end O0, k = 1 Oi D 1, k = 1 O infinite loop with i = 0, k = 0 O infinite loop with i = 1, k=0

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter5: Looping
Section: Chapter Questions
Problem 11RQ
icon
Related questions
Question
Run the following code and display i and k
k = 0; i = 0;
while(k<1 && i <1)
k = 0;
i = i+1; i= i-k-1;
end
1= 0, k = 1
13D1,k= 1
infinite loop with i 0, k = 0
infinite loop with i = 1, k=0
Transcribed Image Text:Run the following code and display i and k k = 0; i = 0; while(k<1 && i <1) k = 0; i = i+1; i= i-k-1; end 1= 0, k = 1 13D1,k= 1 infinite loop with i 0, k = 0 infinite loop with i = 1, k=0
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Types of Expressions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning