×
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
578    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.
Sri Sri Ramakrishna Paramahamsa
The world is needed a mixture of truth and make-believe. Discard the make-believe and take the truth.
Sri Sri Ramakrishna Paramahamsa
3132
38.7
Today So Far
Total View (Lakh)
softetechnologies
01/01/2018     34306
28/06/2017     30941
26/05/2018     30854
02/08/2017     28850
25/06/2018     26169
15/05/2017     24599
01/08/2017     23448
06/07/2017     23179
21/04/2018     19206
14/07/2017     18464
softetechnologies