when we type semicolon in for loop in java it turns into a virus program. Tell all that you know about it
Answers
Answered by
0
Explanation:
semicolon after while loop
asked Jun 20, 2016 by anonymous
3 Answers
A while loop statement as while {condition}
{
statements;
}
always executes the statements within the block whenever the condition is true . But when the condition becomes false then it goes to the immediate next statement after that loop. Semicolon is always used for terminating of statements in C.
But if we want to execute the while loop without body then we write it as: while(condition) or while (condition);
{
}
At the above after the while loop, semicolon is used for terminating the while loop without body and its executes no statement when the condition is true. For ex: this type of while loop (without body) is used in wait & signal simaphore.
BRAINLIST ME
Similar questions