While Loop In C With Example In Hindi

While Loop In C With Example In Hindi :

While Loop In C With Example In Hindi

While Loop को Pretested Loop या Entry Controlled Loop भी कहा जाता हैं क्योंकि इस Loop में सबसे पहले Condition Check होती हैं।

Condition Check होने के बाद , अगर Condition True होती हैं तभी Program का Control , Loop के अंदर Enter करता हैं और  Loop Body के अंदर Define सभी Statements को Check कर उनको Run क़रता हैं। और अंत में initial condition के variable को Increment या Decrement से Update कर वापस While Loop में आ जाता हैं।

मगर  Condition के False होने पर Program का Control , While Loop के अंदर Enter किये बिना बाहर Exit हो जाता हैं।

यानि दूसरे शब्दों में , While Loop , Loop Body के अंदर Define सभी Statements या Blocks को तब तक लगातार Execute करता हैं जब तक  While Loop में Define Condition False न हो जाय।

Syntax –

initial condition ;

while (test_condition)

{

statement 1 ;

statement 2 ;

update of the initial condition;

}

Example 1 .

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr() ;

int x=1 ;

while (x<=10)

{

cout<<x;

x=x+2;

}

cout<<“\n”

}

getch();

}

Example 2.

Write a Program to display Prime Numbers ?

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr() ;

int num , i ;

cin>>num;

i=2 ;

while (i<=num-1)

{

if (num % i == 0)

{

cout<<“It’s not Prime number”;

break;

}

i++;

}

if (i == num)

cout<<“It’s Prime Number”;

}

getch();

}

Example 3.

Write a Program to display Fibonacci Series Or Fibonacci Numbers ?

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr() ;

int a , f=0 , s=1 , t ;

a=0 ;

while (a<=10)

{

t = f+s ;

cout<<t ;

f=s ;

s=t;

a++;

}

getch();

Result-

1 , 2 , 3 , 5 , 8 ,13 , 21 , 34 , 55 , 89 , 144

While Loop In C With Example In Hindi ,

“Switch Case Statement In C In Hindi With Example” , Video को हमारे YouTube channel  में देखने के लिए इस Link में Click करें  ।   YouTube channel link –  (Padhai Ki Batein /  पढाई की बातें)

NOTE – Class 8th , 9th , 10th , 11th , 12th के हिन्दी विषय के सभी Chapters से संबंधित videos हमारे YouTube channel (Padhai Ki Batein /  पढाई की बातें) पर भी उपलब्ध हैं। कृपया एक बार अवश्य हमारे YouTube channel पर visit करें । सहयोग के लिए आपका बहुत – बहुत धन्यबाद।

You are most welcome to share your comments . If you like this post . Then please share it . Thanks for Reading.

यह भी पढ़ें

  1. Nested For Loop In C With Example In Hindi ,
  2. C और C++ क्या हैं ?
  3. C या C++ में पहला Program कैसे बनाते हैं ?
  4. Difference Between If And If Else Statement In C
  5. 6 Small And Simple Programs For Beginners
  6. If And If Else Statement in C
  7. If Else Statement in C
  8. Nested If Else Statement In C
  9. Find Out the Largest Value of any given four And Three Numbers in C
  10. Find Out the Largest Value of any given five Numbers in C
  11. Logical Operators In C Programming
  12. For Loop in C Language
  13. What is HTML Coding
  14. Web Page कैसे बनाते हैं
  15. HTML Form 
  16. How To Create Table In Html
  17. How To Create Hyperlink In HTML
  18. How To Insert An Image In HTML Page
  19. Ordered And Unordered List In HTML
  20. Frame In HTML Coding
  21. Add Background Color And Image
  22. Map in HTML
  23. Nested List In HTML
  24. How To Create A Website Using HTML Only On Notepad No CSS Used
  25. How TO Create A Beautiful And Simple WebPage Using HTML Only (No CSS Used)