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


Please Help Members By Posting Answers For Below Questions

Describe the steps to insert data into a singly linked list.

612


What is bubble sort in c?

625


What does c mean in basketball?

550


What is uint8 in c?

627


What would be an example of a structure analogous to structure c?

566






What does 2n 4c mean?

692


What are header files in c?

604


How can this be legal c?

637


What are the features of c language?

611


When should we use pointers in a c program?

616


How do I get an accurate error status return from system on ms-dos?

633


What is c programing language?

603


What is void main ()?

601


we called a function and passed something do it we have always passed the "values" of variables to the called function. such functions calles are called a) calls by reference b) calls by value c) calls by zero d) none of the above

627


write a program to find the given number is prime or not

3815