×
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
468    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
The highest education is that which does not merely give us information but makes our life in harmon
Rabindranath Tagore
2451
32.45
Today So Far
Total View (Lakh)
softetechnologies
01/01/2018     33208
28/06/2017     29018
02/08/2017     26445
26/05/2018     25948
15/05/2017     22743
06/07/2017     21166
01/08/2017     20872
21/04/2018     18372
25/06/2018     17110
14/07/2017     15996
softetechnologies