what is the difference between while and do while?

Answer Posted / bhairavi

in while loop first condition is checked & then ++/-- is
done, in do while first whatever the condition given loop
execute atleast once ie.if i=0 the condition is while
(i<=0), i++ then also in do while loop i will increment
first & then it will check the condition so final value of
i will be 1

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does %c mean in c?

662


Write a program, where i have a grid with many cells, how many paths are possible from one point to other desired points.

719


find the sum of two matrices and WAP for it.

650


What are the keywords in c?

655


What is a pointer value and address in c?

645






What is function in c with example?

652


In c programming, explain how do you insert quote characters (? And ?) Into the output screen?

781


How is a null pointer different from a dangling pointer?

569


How can I call fortran?

657


any "C" function by default returns an a) int value b) float value c) char value d) a & b

679


What is the use of header?

640


main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }

929


What is wrong in this statement? scanf(ā€œ%dā€,whatnumber);

739


What does %p mean c?

642


develop algorithms to add polynomials (i) in one variable

1755