No products in the cart.

What is loop and its types.daigram …

CBSE, JEE, NEET, CUET

CBSE, JEE, NEET, CUET

Question Bank, Mock Tests, Exam Papers

NCERT Solutions, Sample Papers, Notes, Videos

What is loop and its types.daigram of each type and syntax
  • 1 answers

Sia ? 3 years, 6 months ago

Loop executes the sequence of statements many times until the stated condition becomes false. A loop consists of two parts, a body of a loop and a control statement. The control statement is a combination of some conditions that direct the body of the loop to execute until the specified condition becomes false. The purpose of the loop is to repeat the same code a number of times.

  1. A while loop is the most straightforward looping structure. Syntax of while loop in C programming language is as follows:

    <pre> while (condition) { statements; }</pre>
  2. A do...while loop in C is similar to the while loop except that the condition is always executed after the body of a loop. It is also called an exit-controlled loop.
    Syntax of do...while loop in C programming language is as follows:

    <pre> do { statements } while (expression);</pre>
  3. A for loop is a more efficient loop structure in 'C' programming. The general structure of for loop syntax in C is as follows:

    <pre> for (initial value; condition; incrementation or decrementation ) { statements; }</pre>
http://mycbseguide.com/examin8/

Related Questions

Write a program for swapping two numbers?
  • 0 answers
Define packages
  • 0 answers
What is alu
  • 1 answers
Write a program for swapping two numbers
  • 1 answers

myCBSEguide App

myCBSEguide

Trusted by 1 Crore+ Students

Test Generator

Test Generator

Create papers online. It's FREE.

CUET Mock Tests

CUET Mock Tests

75,000+ questions to practice only on myCBSEguide app

Download myCBSEguide App