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

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter5: Looping
Section: Chapter Questions
Problem 12RQ
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
O i= 0, k = 1
O i= 1, 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 O i= 0, k = 1 O i= 1, 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 with 1 images

Blurred answer
Knowledge Booster
Mathematical functions
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