Question:

Difference between If and While Command (any language)?

by  |  earlier

0 LIKES UnLike

Whats the diffrence?

 Tags:

   Report

2 ANSWERS


  1. "If" will execute a block of code -- once -- if the given expression is true.

    "While" will execute a block of code -- repeatedly -- as long as the expression is true at the top of the loop.


  2. In an "if" statement, the "condition" is evaluated. If it is TRUE, then the code is executed once. That's it. Otherwise, the code is not executed.

    In a "while" statement, the "condition" is evaluated. If it is TRUE, then the code is executed once. Repeat these steps until the "condition" becomes FALSE..

Question Stats

Latest activity: earlier.
This question has 2 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.