Question

If you write a loop, and mistakenly omit the statement that alters to loop control variable,...

If you write a loop, and mistakenly omit the statement that alters to loop control variable, the most likely result is _________.

a. garbage output

b. hardware failure

c. an infinite loop

d. not enough output

0 0
Add a comment Improve this question Transcribed image text
Answer #1

c. an infinite loop will occur

as no iteration will be there and condition will always be true if first condition will be true ..

example:

class abc

{public static void main(String args[])

{

for(int i=0; i<=10;)

{System.out.println("infinite");

}}

}

//above program is in java

//run java prog online

Add a comment
Know the answer?
Add Answer to:
If you write a loop, and mistakenly omit the statement that alters to loop control variable,...
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
  • 10. Write the heading (the first line) of a for statement whose loop control variable alpha...

    10. Write the heading (the first line) of a for statement whose loop control variable alpha counts from 37 through 1 in steps of 1. 11. What is the output of the following code fragment? (All variables are of type int.) limit 8 cout <<'H loopCount = 10; do cout x 'E; loopCount++ } while (loopCount <= limit); cout << "LP"

  • Which of the following is a true statement about loops in C++? A) there are 4 loop statements

    Which of the following is a true statement about loops inC++? A) there are 4 loop statements B) there are 2 loop statements C) there are 3 loop statements D) there are infinite loop statements 25. Which of the following is a true statement about loops inC++? A) while and do...while are most commonly used for countercontrolled loops B) while and do...while are most commonly used for variablecontrolled loops C) while and do...while are most commonly used for event controlledloops...

  • Control Structures and Subroutines I. A while loop whose condition is not made false is called...

    Control Structures and Subroutines I. A while loop whose condition is not made false is called an infi nite loop. However, it is infinite, in the sense of continuing to run forever, only in theory. The loop will stop at some point. Why? 2. To evaluate the if statements in this question below, assume that a Print statement simply prints whatever is in quotes after it. The phrases after a semicolon in the third code fragment are comments and are...

  • Using C language to write a program. First, to write Hello Wrold Second. Use a while...

    Using C language to write a program. First, to write Hello Wrold Second. Use a while loop to calculate the sum of positive even integers below 200 and print the result to the standard output. This is very similar to the sum example we have studied. Think about how much you should increase the loop control variable to get to the next even number. Your program should output the following text. output should be : Hello, World! 9900

  • variable someValue to the streams buffer. an output string stream variable called oss, write a statement...

    variable someValue to the streams buffer. an output string stream variable called oss, write a statement that appends the value of a write a statement that appends the value ofth nt a. css oss. sonevalue; b. 033 someValue Given that a string variable fi1eMame is set to "save ti1e. tab" and an outout file stream varable OFS, which correctly opens the file with the string tilelame as the file name? a. OFS.open (tileName) : b, ofstream open)i c. ofstream,openifilelame) d....

  • Write a Python if statement that calls doWhat() if a and b is true or a...

    Write a Python if statement that calls doWhat() if a and b is true or a and not c is true or e is equal to q. Write an example of a Python for loop that uses a range. Write an example of a Python for loop that iterates on the members of a container such as a list. Show by code example in Python how to concatenate two strings and assign the result to a variable.

  • Question 1 For the following closed-loop control system, identify the element/signal for each number: 1 5...

    Question 1 For the following closed-loop control system, identify the element/signal for each number: 1 5 3 6 oo Actuator 9 7 4 N. A. Desired Output 2 B. Actual Output 3 C. Error 4 D. Sensor 5 E. Controller F. Plant G. Manipulated variable H. Measured Output Control Input

  • Can someone help me with this Python code Summary In this lab, you work with the...

    Can someone help me with this Python code Summary In this lab, you work with the same Python program you worked with in Labs 5-1 and 5-3. As in those earlier labs, the completed program should print the numbers 0 through 10, along with their values multiplied by 2 and by 10. However, in this lab you should accomplish this using a while loop with a break statement. Instructions Make sure that the file NewestMultiply.py is selected and open. Write...

  • Question .(20 marks) Consider a control system shown in Fig.2 has an open loop TE-G(S)H(s)- 49...

    Question .(20 marks) Consider a control system shown in Fig.2 has an open loop TE-G(S)H(s)- 49 S(S+7) A-Prove that the gain margin-infinite db at infinite rad/sec. and the phase margin 51.8 degrees at 5.5 rad/sec.? B-Sketch the polar plot? C- Sketch the Bode plot and show gain margin and phase margin D- Sketch the Nichols plot? E-Write short MATLAB program to solve a, b, C and D? Best Wishes for all Examiners

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
ADVERTISEMENT