Tag

#c loop programs

9 posts

C nested if statements

This statement allows the user to use if block inside the other if block. And the inner if statement is executed only if the outer if statement’s condition is true. Syntax Syntax of nested if statement in C: nested if Flowchart: Example of nested if statement in C: The output of nested if

June 12, 2026Read more →

C Program to Reverse a Number using for loop

In this tutorial, we will write a reverse number in C using for loop. Before that, you may go through the following topics in C. C program to reverse a number using for loop This is a reverse number program in C using for loop where the program takes the input from the user. And … Read more

December 5, 2021Read more →

C – do while loop

do-while loop in C is just as same as while loop, the only difference is that in do-while the condition is always executed after the loop as shown in the syntax below. Unlike while loop, where the body of the loop is executed only if the condition stated is true but in the do-while loop, … Rea

March 12, 2021Read more →

C – while Loop

A while loop is a straightforward loop and is also an entry-control loop. It evaluates the condition before executing the block of the loop. If the condition is found to be true, only then the body of the loop is executed. The loop continues until the condition stated is found to be false. while loo

March 12, 2021Read more →

C – for loop

In C programming, for loop is a more efficient loop structure and is an entry-control loop. The iteration continues until the stated condition becomes false. It has three computing steps as shown in the syntax below. for loop Flowchart: Syntax of for loop. Example of for loop in C Program.

March 12, 2021Read more →

C – switch statement

A switch statement allows a variable to be tested for equality against multiple values and each of those values is called a case. It can be used instead of nested if…else. Switch expression and case value must be of the same type. There must be at least one case or multiple cases with unique c

March 12, 2021Read more →

C – nested switch statement

The use of switch statement inside another switch statement is called nested switch statement. Syntax Syntax of nested switch statement in C: Example of nested switch statements in C: The output of nested switch statements in C. The OUTER Switch. The INNER Switch.

March 12, 2021Read more →

C – if statement

An if statement consists of a Boolean expression followed by one or more statements.If the boolean expression is true, the block of code inside the if statement will be executed else not. Syntax Syntax of if statement in C: if statement Flowchart: Example of if statement in C Program:

March 12, 2021Read more →

C – if…else statement

If the Boolean expression is true then the code inside the if statement block is executed or if it is false then the code inside else statement will be executed. Hence if..else statement. Syntax Syntax of if…else statement in C Language: If…else Flowchart: Example of if…else s

March 12, 2021Read more →