break and continue statement | difference between break and continue statement in c with example

break and continue statement :- Break Condition in c program ko break karne ke liye istemal karte hai & c continue condition ko ham program ko continue karne kar liye use karte hai. Inhe ham example ke sath samanjh te hai.

break and continue statement

Break Condition in C

Break Statement Ko Hamne Is Post me Acchi tarah se Samanjha ya gya hai with Example :

Flow Diagram :-

break and continue statement | difference between break and continue

Syntax :-

break;

Example :-

#include <stdio.h>
 
int main () {

   /* local variable definition */   int a = 1;

   /* while loop execution */   while( a <= 10 ) 
       {
   
      printf("value of a: %d\n", a);
      a++;
  
      if( a == 5)
      {
         /* terminate the loop using break statement */         break;
      }
   }
 
   return 0;
}

Output :-

value of a: 1
value of a: 2
value of a: 3
value of a: 4
value of a: 5

Aap upper diye gye output me dekh sakte hai output keval 5 tak print hua jo ki aapne program ko 10 tak print karane ke liye kaha. lekin wo break condition ki wajah se break ho gya.

Continue Condition in C

Continue Statement Ko Hamne Is Post me Acchi tarah se Samanjha ya gya hai with example :

Flow Diagram

break and continue statement

Syntax :

continue;

Example :-

 #include <stdio.h> 

int main() { 
 // loop initialization expression 
 int i = 1; 

 // infinite while loop 
 while (i<=10)
      { 
  if (i == 5) 
   continue; 

  printf("%d \n ", i); 
  i++; 
 } 

 return 0; 
} 

Output :-

1
2
3
4
6
7
8
9
10

aap Upper diye gye output ko dekh sakte hai ki output me 5 print nhi hua hai kyoki 5 ko continue kar diya gya .

break and continue statement

Dosto mujhe ummed hai ki aap break and continue statement in Hindi ko acchi tarah se samanj gye honge agar aap ko ye post acchi lage to mere is website ko jarur follow kre or ha agar aap video bhi dekhna chahte hai to aap mere channel ko bhi subscribe kar sakte hai. channel ka link aapko home page par mil jayega |

Danish Ali

I Am a Cyber Security Student & I have Skills C, C++ ,Python, HTML,CSS, Computer & Advance Hacking & Blogger & YouTuber.

View Comments

  • I have been surfing online more than three hours nowadays, but I by no means discovered any fascinating article like yours. It is beautiful worth enough for me. In my opinion, if all webmasters and bloggers made just right content as you did, the web can be much more useful than ever before.

Share
Published by
Danish Ali

This Website Uses Cookies in order to offer you the most relevant information.Please accept cookies for optimal performance