×
FREE ASSISTANCE FOR THE INQUISITIVE PEOPLE
Tutorial Topics
X
softetechnologies
Write a c Programming to create a binary pyramid. - MAKAUT / WBUT MCA 2012 C function to reverse a string and find the smallest divisor of an integer - WBUT MAKAUT MCA 2012
Differentiate between do-while and while statements WBUT MCA 2012 - C Language
377    Arnab De    09/04/2020

Differentiate between do-while and while statements with suitable example.   WBUT MCA 2012

do-while and while both are loop or iteration in c language, But they are differently way of execute the loop.

softetechnologies
do-while while

1.  It is an exit loop. i.e. when we are exit from the loop then only the condition will be checked. If the condition is true then only the codes written with-in it will execute.

1.  It is an entry loop. i.e. when we are entered into the loop then the condition will be checked. If the condition is true then only the codes written with-in it will execute.

2.  Whatever the logic, the codes are written within a do-while loop must execute at least one time.

2.  The codes are written within a while loop execute as per the logic.

3.  “do-while” loop ends with a semi-colon sign(;)

3.   ”while” loop does not use any semi-colon (;).

4.  Syntax:

do
{
       ........   // codes as per logic
       ........
}while(<condition>);

4.  Syntax:

while()
{
       ........   // codes as per logic
       ........
}
softetechnologies
Write a c Programming to create a binary pyramid. - MAKAUT / WBUT MCA 2012 C function to reverse a string and find the smallest divisor of an integer - WBUT MAKAUT MCA 2012
softetechnologies
Author Details
Arnab De
I have over 16 years of experience working as an IT professional, ranging from teaching at my own institute to being a computer faculty at different leading institute across Kolkata. I also work as a web developer and designer, having worked for renowned companies and brand. Through tutorialathome, I wish to share my years of knowledge with the readers.
Enter New Comment
Comment History
No Comment Found Yet.
Nelson Mandela
An educated, enlightened and informed population is one of the surest ways of promoting the health of a democracy.
Nelson Mandela
908
27.09
Today So Far
Total View (Lakh)
softetechnologies
01/01/2018     32016
28/06/2017     27107
02/08/2017     24056
26/05/2018     22400
15/05/2017     20704
06/07/2017     19660
01/08/2017     17964
21/04/2018     17537
01/07/2017     15044
25/04/2018     14306
softetechnologies