![]() ![]() The key thing to note about the above program is −Įach ‘if else’ code is placed in the brackets (). If %c%=10 (echo "The value of variable c is 10") else (echo "Unknown value") If %c%=15 (echo "The value of variable c is 15") else (echo "Unknown value") The following example shows how the ‘if’ statement can be used for off The evaluation of the ‘if’ statement can be done for both strings and numbers. Just like the ‘if’ statement in Batch Script, the if-else can also be used for checking variables which are set in Batch Script itself. The following diagram shows the flow of the ‘if’ statement. ![]() If the condition is false, it then executes the statements in the else statement block and then exits the loop. If the condition is true, it then executes the statements thereafter and stops before the else condition and exits out of the loop. The general working of this statement is that first a condition is evaluated in the ‘if’ statement. If (condition) (do_something) ELSE (do_something_else) Following is the general form of this statement. The next decision making statement is the If/else statement. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |