Switch Case Statement in C/C++ Tutorial with Examples

Switch Case Statement in C/C++ Tutorial with Examples

C/C++ programming languages provides switch … case statement for selection according to given switch state. switch  … case can be used for different cases in order to control the flow of the application. Syntax switch … case has the following syntax. switch(EXPRESSION) {  case CONDITION1:    CASE1_CODE; break;  case CONDITION2:    CASE1_CODE; break; … default: … Read more

Awk If, If Else, Else Statement or Conditional Statements

Awk If, If Else, Else Statement or Conditional Statements

Awk is a very popular text processing tool. Awk provides different functionalities and structures like programming languages. if – if else is a very useful conditional statement used to create decision trees. if – if else used to check the given situation or operations and run accordingly. For example, we can check the age of the person … Read more

Php – If..Elseif..Else Conditional Statements

[rps-include post=6522] Php provides ability to write applications according to decision making with given statements or comparative tests. We can test given situations and conditions and dictate application execution. For example we want to check given integer value and print the positiveness and negativeness. Here we need to check this situation with if-elseif-else conditional statements. If … Read more

C – If Else , Switch, Decision Making

[rps-include post=6557] Conditions or Decisions making is one of the most important aspect of programming languages. Actual programming logic is implemented in the decisions. According to decisions the application will be branched and expected results or operations will be accomplished. There are 3 main decision making mechanisms. We will look in details below. If The syntax … Read more

Linux Bash If-Else Conditionals Tutorial with Examples

Linux Bash If-Else Conditionals Tutorial with Examples

If-Elif operators are used to designing the flow of the bash script. We can change the flow according to given conditions with If-Elif . If-Else is one of the most used keywords or structures in Bash in order to make a different execution path according to the situation. For example, if given process ID or programs executes … Read more

Javascript Decision Making with If-Else

Programs are mainly written on decisions. Decisions makes an application more flexible and rich. Javascript supports decisions too. A decision example might be like this: If person age above 17 set him adult. Single If We can define more complex decisions but for now we will look into simple decision. var age=19; if(age>17){ console.log(“You are … Read more

Python Pass Statement

Python provides different keywords which do not exists in other programming languages.  pass is one of the original keyword used for  nothing. pass keyword is a requirement for python block specification and syntax. Why To pass? Other languages generally uses some block specifier like {} or ;  etc. For example we can define functions but if we … Read more

Python If-Elif-Else Multiple Conditionals Like And , Or

We have already looked if-elif-else statements in previously. if-elif-else requires conditions in order evaluate. These conditions may simple True , False or comparisons. The other way is we can define complex conditionals in order to evaluate. Simple Conditions Simple conditions are just single statement conditions where we do not need grouping or multiple or , and . We will just check … Read more

Python Boolean Variable Types

Logic operations are one of the important topics in application development. Python supports logic operations and value as boolean. Boolean is data type used to represent logic values True and False. True generally used to positive or enabled situations. False is generally used negative or disabled situations. For example if we want to express existence of an item … Read more

Python If .. Elif .. Else Statements and Conditionals

Decision making one of the fundamentals operations in programming languages and applications. We mostly use decisions to implements applications logic. The primary mechanism for decisions in Python is if..elif..else keywords. We can simple call them if-else . In this tutorial we will look different aspects and usage  examples of if-else. If If is used to check whether given … Read more