Posts

Showing posts with the label if-else statement example

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...

if and if-else statement in C programming language

Image
  If and if-else statements in the C programming language When we start writing a program, if the program is simple, like adding two numbers, or a Hello World program, we don't need any decision-making in such programs.  But as the programs get complicated, they become complex, and we must make decisions. For such programs, we use conditional statements, which help in making decisions. One of the most important conditional statements is 1) if statement 2) if-else statement What is the if condition? It is a conditional statement used in almost every programming language. The if statement executes a piece of code based on a specific condition when it is true. When the condition is true, it executes the code with curly brackets. What is the syntax of if statement  The if statement has a very simple syntax, as shown below if (condition) { //This piece of code will run if the given condition is true } the above line of code tells us that when the conditio...