what is the difference between while and do while?

Answers were Sorted based on User's Feedback



what is the difference between while and do while? ..

Answer / jithender palle

In while case first execute the condition then ++/--,
In do while first ++/-- then condition execute

Is This Answer Correct ?    9 Yes 0 No

what is the difference between while and do while? ..

Answer / 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

More C Interview Questions

count the numbers between 100 and 300, that star with 2 and ends with 2

5 Answers   Mind Tree,


Write a client and server program in C language using UDP, where client program interact with the Server as given below: i) The client begins by sending a request to send a string of 8 characters or series of 7 numbers, the server sends back a characters or numbers as per the request of the client. ii) In case of series of 7 numbers: The client sends a multiplication of numbers, to the server. iii) In case of a string of 8 characters: The client sends a reverse order of string to the server.. iv) Server will send an acknowledgment to the client after receiving the correct answer

1 Answers   Ignou, Microsoft,


write a c program to find the roots of a quadratic equation ax2 + bx + c = 0

11 Answers   CSC, St Marys, TATA,


How can I invoke another program or command and trap its output?

1 Answers  


How to implement a packet in C

1 Answers   Aricent,


write a program to display the array elements in reverse order in c language

16 Answers  


Differentiate between calloc and malloc.

1 Answers   Wipro,


what is the disadvantage of using macros?

1 Answers   Wipro,


How do you convert strings to numbers in C?

0 Answers  


Explain what is the difference between text files and binary files?

1 Answers  


Explain union.

1 Answers  


What is queue in c?

1 Answers  


Categories