Years Old
IS OFFLINE
1 POSTS & 0 LIKES
New Member
|
Post by civam61813 on Jan 3, 2024 9:01:46 GMT 1
Line is executed sequentially we don't need the program to determine the value of a specific condition. By using conditional statements, a program can determine whether certain conditions are met and then determine what to do next. Let’s look at some examples where conditional statements can be used. If the student’s test score exceeds, report the grade as passing. Otherwise report the grade as negative. If the customer has money in the account, charge interest, otherwise charge a penalty. If the customer purchases oranges or more, a discount is calculated. If they buy less then Country Email List the discount is not calculated We wrote the conditional code by evaluating the conditional value and choosing which code to run based on whether those conditions are met. This article will guide you through creating conditional statements in . Contents Statements in Statements Nested Statements in Statements We'll start with the statement and it will evaluate whether the statement is true or false and run the code only if that statement is true. Open the file in any text editor and create the following code Using this code we get the point variable.
|
|