×
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
315    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.
Swami Vivekananda
If the poor cannot come to education, education must reach them, at the plough, in the bakery factor
Swami Vivekananda
484
23.83
Today So Far
Total View (Lakh)
softetechnologies
01/01/2018     30778
28/06/2017     25550
02/08/2017     22003
26/05/2018     19717
15/05/2017     19354
06/07/2017     17901
21/04/2018     16863
01/08/2017     16539
01/07/2017     14552
25/04/2018     13617
softetechnologies