Abdulhafiz Suleiman Danmaigoro Show
IntroductionHuman beings designed computer systems to make life easier for themselves. Computers make our life easier in various ways, too many to mention. For example, we use computers to perform complex ANOVA calculations, and computers are used to run software programs. Since computers cannot think on their own, and human beings want to put computers into performing complex and even simple works, software need to be designed to run on the computer system and give it certain instruction to follow. To be able to know and understood the activity it needs to perform for its owner at any given time. Programing languages are used to achieve these aims. Conditional statements, expressions, or simply conditionals are features of programming languages that tell the computer to execute certain actions, provided certain conditions are met. Conditional statements are used
through the various programming languages to instruct the computer on the decision to make when given some conditions. These decisions are made if and only if the pre-stated conditions are either All programming languages have conditional expression syntax (although the syntax slightly differs from one programming language to the others). For example, a typical C# conditional statement reads thus:
C# language demo of if, else if and else conditional statements From the above example, we can see how a program could be used to express various decisions based on the truthy or falsy of the given conditions. Besides The conditional statements are vital in the field of programming and software engineering, in that the conditions can be used by the programmers and software engineers to allow a machine to simulate the behavior of a person who has the ability to make choices and perform some actions based on the decision taken. With conditional expressions, programming language gives the programmers tools and features they can manipulate to set a machine to effective work. For the sake of clarity, let’s dive into the types of conditional statements. Bear in mind that all conditional statements return bool, i.e., true or false. if statementThe if
Checks **if** the day is Monday which can result to only true or false (bool). else if statementWhile the
Checking Multiple Conditional Statements with, if, else if In else statementThe
Example of else statement
|