×
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
1203    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.
Rabindranath Tagore
A lamp can only light another lamp when it continues to burn in its own flame.
Rabindranath Tagore
2032
60.43
Today So Far
Total View (Lakh)
softetechnologies
26/05/2018     44655
01/01/2018     36856
25/06/2018     36685
28/06/2017     34875
02/08/2017     33472
01/08/2017     27830
06/07/2017     27599
15/05/2017     27166
14/07/2017     22912
11/09/2018     21630
softetechnologies