Loops in C

Learn all about loops in c programming, including types of loop, How to use a loop in C

Loop is a mechanism that allows us to perform certain task again and again repeatedly just by writing once.

Why Loops

Q. Write a program that prints your name 300 times?

How will you do? Will you write 300 times printf() statement.

In programming when it’s required to de some task again and again repeatedly we can use loops.

Types of loop in C

In C programming there are 3 types of loop.

  1. for loop
  2. while loop
  3. do while loop

These three loops do the same thing, but the way of doing is deferent from each other.

It is totally depends on programmer that which loop he is going to use for solving the problem. Basically should analyse the problem and then we should decide to choose the loop for solving the problem. This is all about to make the solution easy.

We will study all these three types of loops one by one in upcoming chapters.

Loop Control Statements

There are three types of loop control statements, these are used to break, skip or jump in loop.

  • break
  • continue
  • goto

After learning all loops, we will learn loop control statements.

Email Us: advertise@gdatamart.com

Donate Us: Support to GDATAMART

© 2023 GDATAMART.COM (All Rights Reserved)