In computer programming, a loop is a sequence of commands or statements that are repeated many times.
Looping statements in C language
- for statement
- while statement
- do…while statement
Let us learn C programming Looping concept by executing following programs.
C programs based on for loop
- 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 Z to A using for loop.
- To print sum of series 1 + 1/2 + 1/3 + 1/4 + ....N
C programs based on while loop
C programs based on do…while loop
- 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.
Sample Program based on Looping concept
#include<stdio.h> int main() { int i; for(i=1; i<=10; i++) { printf("%d ", i); } return 0; } Output of program 1 2 3 4 5 6 7 8 9 10 |
What is looping aapne ye to btaya hi nhi
ReplyDeleteDear visitor,
DeleteLooping means: "In computer programming, a loop is a sequence of commands or statements that are repeated many times".