What is the diffrent between while and do while statement ?
Answer Posted / shwetha karkera
In WHILE STATEMENT, the condition is tested first, and then
the statements are executed if the condition turns out to
be true. hence, it is calles as PRE-TESTED LOOPING
CONSTRUCT.
In DO WHILE STATEMENT,the statements are executed for the
first time and then the conditions are tested. if the
condition turns out to be true,then the statements are
executed again.hence it is called as POST-TESTED LOOPING
CONSTRUCT.
SYNTAX FOR WHILE STATEMENT:
while(condition)
{
statement;
}
SYNTAX FOR DO WHILE STATEMENT:
Do
{
statement;
}
while(condition)
| Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
Do pointers need to be initialized?
Can two or more operators such as and be combined in a single line of program code?
What is the purpose of the statement: strcat (S2, S1)?
how many errors in c explain deply
Explain main function in c?
What is the significance of an algorithm to C programming?
What is the difference between int main and void main in c?
how to print electricity bill according to following charges first 100 units -1rs per unit for next 200 units-1.50 rs per unit without using conditions
Explain how can a program be made to print the line number where an error occurs?
Can a variable be both const and volatile?
can we change the default calling convention in c if yes than how.........?
What is the usage of the pointer in c?
Where can I get an ansi-compatible lint?
provide an example of the Group by clause, when would you use this clause
What is %g in c?