Posts

Showing posts with the label Switch statement in c programming language

What is Recursion in C++ programming language

Image
 What is Recursion in C++ programming language Today in this blog post we will cover the concept of Recursion in C++ programming language for  beginners. So what is Recursion? And what is the use of Recursion in programming languages? We will cover the answer of these questions shortly. For now let us look at the basic introduction of Recursion. Recursion is a concept in which the function calls itself with in its own body, and breaks the complex problems into smaller and more manageable parts. So the first question was what is recursion? Basically Recursion is a method or technique which is used in programming languages and in this method the function calls itself. It means the function is called with in its own body. We will cover this concept with simple programming example which will make the concept of recursion crystal clear to the audience. The Second question was what is the use of Recursion in programming languages? Recursion simply breaks down complex problems or pro...

Switch statement in c programming language

Image
  Switch statement in c programming language What Is a switch statement? The switch statement is a conditional statement that we use to run different code sections based on some conditions. The switch statement also works like the if else-if else ladder statement. As we know in the else-if ladder statement we implement multiple conditions it is exactly how the switch statement works. In the switch statement, we use the term case: that tells us about any specific condition within the switch expression area switch(expression).   What is the syntax of a switch statement in c programming switch(Some_Epression) { case value1: // insert code here break; case value2: // insert code here break; default: // insert code here } Rules and regulations of switch statement: Always remember that the expressions that are used within the switch statement i.e. switch(expression), this expression must be a single character or an integer value. As discussed earlier  case: ...