Class 6 Exam  >  Class 6 Questions  >  Choose a correct C Statement regarding for lo... Start Learning for Free
Choose a correct C Statement regarding for loop.
for(; ;);
  • a)
    for loop works exactly first time
  • b)
    for loop works infinite number of times
  • c)
    Compiler error
  • d)
    None of the above
Correct answer is option 'B'. Can you explain this answer?
Most Upvoted Answer
Choose a correct C Statement regarding for loop.for(; ;);a)for loop wo...
We are not specifying condition to exit the loop. Eg. for(a=0;a<10;a++)
Free Test
Community Answer
Choose a correct C Statement regarding for loop.for(; ;);a)for loop wo...
Explanation:

The for loop syntax
The for loop is a control flow statement that allows us to repeatedly execute a block of code based on a specified condition. It consists of three parts:

1. Initialization: This part is executed only once at the beginning of the loop. It is used to initialize the loop variable.

2. Condition: This part is evaluated before each iteration of the loop. If the condition is true, the loop continues; otherwise, the loop is terminated.

3. Increment/Decrement: This part is executed after each iteration of the loop. It is used to update the loop variable.

The syntax of the for loop is as follows:
for (initialization; condition; increment/decrement) {
// code to be executed
}

The given statement:
for (; ;) {

}

Explanation:
In the given statement, all three parts of the for loop are empty. This means that there is no initialization, no condition, and no increment/decrement.

- Since there is no initialization, the loop variable is not assigned any initial value.
- Since there is no condition, there is nothing to evaluate before each iteration. As a result, the condition is considered to be true.
- Since there is no increment/decrement, the loop variable remains unchanged in each iteration.

As a result, the for loop will continue to execute infinitely without any termination condition. This is known as an infinite loop.

Correct Answer:
The correct answer is option B) for loop works infinite number of times.
Explore Courses for Class 6 exam
Question Description
Choose a correct C Statement regarding for loop.for(; ;);a)for loop works exactly first timeb)for loop works infinite number of timesc)Compiler errord)None of the aboveCorrect answer is option 'B'. Can you explain this answer? for Class 6 2025 is part of Class 6 preparation. The Question and answers have been prepared according to the Class 6 exam syllabus. Information about Choose a correct C Statement regarding for loop.for(; ;);a)for loop works exactly first timeb)for loop works infinite number of timesc)Compiler errord)None of the aboveCorrect answer is option 'B'. Can you explain this answer? covers all topics & solutions for Class 6 2025 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Choose a correct C Statement regarding for loop.for(; ;);a)for loop works exactly first timeb)for loop works infinite number of timesc)Compiler errord)None of the aboveCorrect answer is option 'B'. Can you explain this answer?.
Solutions for Choose a correct C Statement regarding for loop.for(; ;);a)for loop works exactly first timeb)for loop works infinite number of timesc)Compiler errord)None of the aboveCorrect answer is option 'B'. Can you explain this answer? in English & in Hindi are available as part of our courses for Class 6. Download more important topics, notes, lectures and mock test series for Class 6 Exam by signing up for free.
Here you can find the meaning of Choose a correct C Statement regarding for loop.for(; ;);a)for loop works exactly first timeb)for loop works infinite number of timesc)Compiler errord)None of the aboveCorrect answer is option 'B'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Choose a correct C Statement regarding for loop.for(; ;);a)for loop works exactly first timeb)for loop works infinite number of timesc)Compiler errord)None of the aboveCorrect answer is option 'B'. Can you explain this answer?, a detailed solution for Choose a correct C Statement regarding for loop.for(; ;);a)for loop works exactly first timeb)for loop works infinite number of timesc)Compiler errord)None of the aboveCorrect answer is option 'B'. Can you explain this answer? has been provided alongside types of Choose a correct C Statement regarding for loop.for(; ;);a)for loop works exactly first timeb)for loop works infinite number of timesc)Compiler errord)None of the aboveCorrect answer is option 'B'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Choose a correct C Statement regarding for loop.for(; ;);a)for loop works exactly first timeb)for loop works infinite number of timesc)Compiler errord)None of the aboveCorrect answer is option 'B'. Can you explain this answer? tests, examples and also practice Class 6 tests.
Explore Courses for Class 6 exam
Signup to solve all Doubts
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev