answersLogoWhite

0


Best Answer

Of course the for loop is terminated in C. All statements are terminated. Look at the syntax of the for statement...

for (init-statement; test-condition; loop-statement) body-statement;

That looks quite terminated to me. (By the semi-colon)

Perhaps you are thinking about statement blocks...

for (init-statement; test-condition; loop-statement) {

statement;

statement;

...

statement;

}

... Well, that is just fine because the body-statement, like any other statement, can be replaced by one or more statements enclosed in braces. There is still a terminating semi-colon on each statement.

if i am understanding ur ques. right then according to me it is correct that for loop is not terminated because we do not execute for loop.we only check the conditions. those statements are terminated which we want to execute. because using a semicolon or terminating the statement means that statement is execitable.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Why for loop is not terminated in c?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

In endless loop the value of i2 k10 and the loop will terminated when value of you is greater than k and the value of k is assign to 17 after the loop and it is said to endless loop why?

"In endless loop the value of i2 k10 and the loop will terminated when value of you is greater than k and the value of k is assign to 17 after the loop and it is said to endless loop why?"


How c strings are terminated?

c strings are terminated by \0 character


How is a positive feedback stopped?

The positive feedback loop is terminated by the end of childbirth...


Which loop is also called an exit-condition loop in C programming?

The do while loop is also called an exit condition loop in c, c++, and java.


Can an if statement or if loop be terminated with a semicolon in c language?

If I'm reading your question right,loops and if statements with one line of code after can be terminated with a semicolon ie, if(a > b) b = a; is fine. HOWEVER, it is better coding practice to use braces to contain your code. Looks tidier and more uniform. eg, if(a > b){ b = a; } If you are talking about breaking out of a loop, try using 'break'.


Can an for loop be terminated with a semicolon in c language?

Sure.for (i=0; i


In c plus plus class is terminated by semicolon but in java it is not terminated?

True.


In C which loop is embedded within another loop?

The nested loop.


What is the result of non-terminated loop?

You mean a loop that has no exit condition. The end result is undefined behaviour. The program may loop indefinitely until manually ejected from memory (forcibly terminated), or it may crash through a lack of resources. Worst case: if the loop doesn't periodically allow for message processing within a multi-threaded environment, the system will be sluggish or unresponsive, possibly forcing a reboot.


Which Loop avoids check at every iteration?

All loops available in Java (for, while, do-while) have a loop termination condition that would get executed during every iteration of the loop. Without checking the loop condition the loop cannot be terminated and hence avoiding the loop condition check during iteration is not logic and Java does not do it.


Is do while loop in c is exit controoled loop?

yes


What is odd loop in 'C' program?

odd loop means at least the loop execute once.