Learn C Language Basics | Learn C Programming loops concept

loops in c programming

In C programming language, a loop is a sequence of instruction s that is executed repeatedly until a certain condition is satisfied. Mostly, a specific process is done, such as getting data and changing it, and then some prescribed condition is checked such as whether a counter has reached a prescribed number. Here in this C programming tutorial we use almost all types of loops in our programs.

Below flowchart describes the working of a typical loop in C programming.
loop example in c programming

C programming language provides the following types of loop to handle looping requirements.

WHILE LOOP IN C

while a given condition is true, a statement or group of statements is executed continuously in c language. Initial condition is always checked before executing the loop body as shown below.

while loop in c program

FOR LOOP IN C LANGUAGE

A variable which is initialized to a prescribed value is compared with a condition, if true then body of the loop is executed and variable is incremented the loop will continue to go no until it reached the prescribed value. for loop structure is like initialization, condition and finally increment. For loop is one of the best used loop in C programming.

for loop in c programming
DO WHILE LOOP IN C PROGRAMMING LANGUAGE

In C language, do while loop, the condition is checked after executing the loop body. It is just like the while loop the difference is condition is checked only at end, as it is called as exit controlled loop.

do while loop in c language

NESTED LOOPS IN C

In nested loops, a loop is used with in another loop which makes a nested structure of loops in C language, C programming language provides this capabilities.

nested loop in c programming

BREAK STATEMENT IN C PROGRAM

If test condition returns true, Terminates the loop or switch statement and transfers execution to the statement immediately following the loop or switch. Break is used to exit a loop in C language.

break statement in c programming

CONTINUE STATEMENT IN C LANGUAGE

Causes the loop to jump over the remaining portion of its body and immediately retest its condition prior to reiterating.

continue statement in c language
GOTO STATEMENT IN C PROGRAMMING

Jumps over and Transfers control to the labeled statement. Due to compiler issues it is not recommended to use these statements

goto statement in c programming


===========================================================================

C Programming Modules

===========================================================================

1 . History Of C programming Language

2 . Data Types

3 . Variables & Constants

4 . Operators & Expressions

5 . Decision Making

6 . Loops

7 . Arrays

8 . Functions

9 . Pointers

10 . String Handling

11 . File Handlings

12 . Storage Classes

13 . Preprocessing

===========================================================================