ErrorException Message: Argument 2 passed to WP_Translation_Controller::load_file() must be of the type string, null given, called in /home3/equicklearning/public_html/wp-includes/l10n.php on line 838
https://www.equicklearning.com/wp-content/plugins/dmca-badge/libraries/sidecar/classes/ Decision Control Statements in C Language - Equick Learning
Home Programming Languages Decision Control Statements in C Language

Decision Control Statements in C Language

0






Decision Control Statements in C Language

Decision Control Statements in C Language

Decision statement दी गई condition की जांच करता है और फिर अपने sub block को execute करता है। decision statement किसी दी गई condition के True या False के बाद execute किए जाने वाले statement को तय करता है।

Types of decision statements:

  1. If statement
  2. If-else statement
  3. Nested if-else statement
  4. Break statement
  5. Continue statement
  6. Goto statement
  7. Switch() statement
  8. Nested switch ()case
  9. Switch() case and Nested if
Statement Syntax
If statement if(condition) statement;
If-else statement If (condition)
  {
  Statement 1;
  Statement 2;
  }
  else
  {
  Statement 3;
  Statement 4;
  }
Nested if-else statement If (condition)
  {
  Statement 1;
  Statement 2;
  }
  Else if (condition)
  {
  Statement 3;
  Statement 4;
  }
  Else
  {
  Statement 5;
  Statement 6;
  }
Break statement Break;
Continue statement Continue;
Goto statement goto label;
Switch() statement Switch (variable or expression)
  {
  Case constant A:
  Statement;
  Break;
  Case constant B:
  Statement;
  Break;
  Default:
  Statement;
  }

LOOP CONTROL STATEMENTS

C में loop control statements तब तक looping ऑपरेशन करने के लिए उपयोग किए जाते हैं जब तक कि दी गई condition सही न हो। एक बार condition गलत होने के बाद control loop statement से बाहर आ जाता है।

Types of Loop Control Statements:

  1. For loop
  2. Nested for loops
  3. While loop
  4. do-while loop
  5. do-while statement with a while loop
Statement Syntax
For loop For(initialize counter; test condition; re-evaluation parameter)

{

Statement;

Statement;

}

Nested for loop for(initialize counter; test condition; re-evaluation parameter)

{

Statement;

Statement;

for (initialize counter; test condition; re-evaluation parameter)

Statement;

Statement;

}

}

While loop While (test condition)

{

Body of the loop

}

Do while loop do

{

Statement;

}

While(condition);

Do-while with while loop Do while(condition)

{

Statement;

}

While (condition);

 

 

 


NO COMMENTS

LEAVE A REPLY

Please enter your comment!
Please enter your name here