Looping In C In Hindi/ While, Do While For Loop हिंदी में|While, Do While For Loop In Hindi?

हेलो Friends, इस ब्लॉग पोस्ट(While, Do While For Loop In Hindi) में मैं आपको Looping के बारे में बताने वाला हूँ | जैसे कि while, do-while, for, nested for loop | इन loops का program में बड़ा ही important role होता है |

यह एक ऐसी प्रक्रिया है जिसमे define कि गयी condition के true रहने तक ब्लॉक में लिखे statement लगातार run होते है, जब तक कि define कि गयी कंडीशन false नहीं होती |While, Do While For Loop In Hindi|

While Do While For Loop In Hindi:

while Loop :

यह एक looping statement है इसमें define की गयी condition के सही रहने तक command के statement लगातार run होते है|

एक program बनाइये जिसमे 1 तो 100 तक की गिनती display हो |

#include<stdio.h>
#include<conio.h>
main()
{
int n = 1;
While(n<=100)
{
printf(“%d”,n);
n++;
}
getch();
}

Do while Loop:

इसे पोस्ट test loop भी कहा जाता है, इसमें पहले command के set execute होते है , तथा बाद में condition execute होती है |

अतः command के set रन होने के पश्चात एक बार condition और चेक होती है, जबकि while statement pretest loop होता है|

Syntax:
Do
{
statement;
}
While(condition);

Program:

#include<stdio.h>
#include<conio.h>
main()
do
{
int i = 1;
While(i<=10);
{
printf(“%d\t”, i);
i++;
getch();
}}

For Loop :

यह सबसे powerful loop होता है | यह एक निश्चित समय में program के section code execute करता है |

इसका प्रयोग मुख्य रूप से तब करते है जब हमें यह मालूम हो कि एक निश्चित समय के अंतरगर्त हमें command के sets कितनी बार execute करना है |

Syntax:

for(initialization; test expression; increment value);

इनमे तीन मुख्य expression define किये जाते है, सबसे पहले varibale को value प्रदान कि जाती है|

फिर condition define कि जाती है| तथा अंत में variable की वैल्यू में increment या decrement करते है |

Program:

#include<stdio.h>
#include<conio.h>
main()
{
int n;
for(n=1; n<=20; n++)
{
printf(“%d”,n);
}
Getch;
}

Nested For Loop :

जब किसी for loop को एक दूसरी loop के अंतर्गत inclosed किया जाता है, तो इसे nested for loop कहते है |

इसमें first लूप द्वारा execute किये गए command inner loop के द्वारा पुनः execute किये जाते है|

program:

#include<stdio.h>
#include<conio.h>
main()
{
int x, y, sum;
for(x=1; x<=5; x++)
{
for(y=1; y<=3; y++)
{
sum = x+y;
printf(“x = %d, y=%d, sum=%d\n”, x,y,sum);
}}
getch();
}

You can also go through a few more amazing blog links related to C/C++:

Problems of procedure-oriented language in Hindi…
This Pointer In C++ In Hindi…
how to learn c language easily…
C Language Interview Question In Hindi…
Looping In C In Hindi…
Switch Statement In C In Hindi…
IF Statement In C In Hindi…
IF-Else Statement In C In Hindi…
Nested If-Else Statement In C In Hindi…
Top to bottom vs Bottom-up programming approach in Hindi…

Quick Q&A:

What is a loop in C and types? C लैंग्वेज में loop और उसके प्रकार को explain करिये?

C language के अंदर लूप जो है वो एक conditional concept होता है जिसकी मदद से हम किसी लाइन अथवा code के एक block को execute करते है |

C लैंग्वेज में तीन प्रकार के लूप होते है For Loop, While Loop, and Do While Loop .

What is loop and its function? लूप और उसके फंक्शन्स क्या होते है?

Loop जो है वो एक programming structure होता है जिसके अंदर कुछ instructions के सीक्वेंस को रिपीट किया जाता है जब तक कि एक specific कंडीशन पूरी न हो जाये|

लूप की मदद से हम प्रोग्राम में उपयोग होने ऐसे प्रोसेस जिन्हे बार बार रिपीट किया जाना है को बिना बार बार लिखे execute कर सकते है और उससे रिजल्ट प्राप्त कर सकते है |

What are the 4 parts of loops? Loop में 4 parts कौन कौन से होते है?

आमतौर पर किसी भी Loop में 4 parts होते है:

Initialization expression
Test expression
Update expression
The body of the loop.

For Loop और while Loop को हम entry controlled Loop कहते है और do -while Loop को हम exit कंट्रोल्ड Loop कहते है |

Which loop is faster in C language? C language में कौन सा Loop fast होता है?

Do-While लूप C programming में सबसे फ़ास्ट Loop होता है|

What is the difference between a while loop and for loop? For Loop और while Loop में क्या difference होता है?

for Loop और while Loop दोनों का उपयोग ही प्रोग्राम में इंस्ट्रक्शन को बार बार रिपीट करने के लिए होता है |

इन दोनों लूप के बीच major difference यह होता है कि for Loop में हमें यह पता रहता है यह Loop कितनी बार चलना है, कहने का मतलब iteration हमें पता होते है|

जबकि while लूप में execution तब तक होता है जब तक कि program condition wrong prove न हो जाये|

Which loop is better for or while? for और while लूप में से कौन सा बेहतर है?

for Loop हमें तब use करना है जब हमें यह पता होता है कि Loop कितनी बार execute होना है | और while लूप हम तब use करते है जब हम किसी फाइल को variable में read करते है |

while लूप हम तब use करते है जब हम यूजर से input लेते है | while लूप का उपयोग हम तब भी कर सकते है जब increment value एक non -standard value हो|

इस ब्लॉग(While, Do While For Loop In Hindi) को लेकर आपके मन में कोई भी प्रश्न है तो आप हमें इस पते a5theorys@gmail.com पर ईमेल लिख सकते है|

आशा करता हूँ, कि आपने इस पोस्ट ‘Looping In C In Hindi: While, Do While, For, Nested For’ को खूब एन्जॉय किया होगा|

आप स्वतंत्रता पूर्वक अपना बहुमूल्य फीडबैक और कमेंट यहाँ पर दे सकते है|While, Do While For Loop In Hindi|

आपका समय शुभ हो|

Anurag

I am a blogger by passion, a software engineer by profession, a singer by consideration and rest of things that I do is for my destination.