## Pages

### Looping

In computer programming, a loop is a sequence of commands or statements that are repeated many times.

### Looping statements in C language are as under:

1. for statement
2. while statement
3. do…while statement

Let us learn C programming Looping concept by executing following programs.

1. C programs based on for statement:

### C program to print 1 to 10 numbers using for loop. C program to print 10 to 1 numbers using for loop. C program to find the sum of first 100 natural numbers. C program to check whether entered number is odd or even. To print Fibonacci Series. (0, 1, 1, 2, 3, 5, ....). Printing Swastik Pattern using for loop. To print A to Z using for loop. To print sum of series 1 + 1/2 + 1/3 + 1/4 + ....N

2. C programs based on while statement:

### Print A to Z using while loop. Print 10 to 20 numbers using while loop. Program to count no. of digits in a given number. Calculate the power of an integer without use of inbuilt math function. Program to count words in a given string. GCD of two numbers.

3. C programs based on do…while statement:

### C program to print Z to A using do..while loop. C program to print series 1 3 5 7... 19 using do..while loop. Program to display MENU using do..while. Sample Programs:

 #include int main() {   int i;   for(i=1; i<=10; i++)   {     printf("%d ", i);   }   return 0; } /*Output 1 2 3 4 5 6 7 8 9 10 */

* * * * *

#### 1 comment:

1. thank you for sharing useful post.
c++ programming tutorial
welookups