Question:

Source code for loop?

by  |  earlier

0 LIKES UnLike

Source code for loop?

 Tags:

   Report

3 ANSWERS


  1. while loop:

    int i=0;

    while(i<desired_value)

    {

    //do something

    //put anything you want inside the the loop here

    i++;

    }

    do..while loop:

    do

    {

    //do something

    //put anything you want inside the the loop here

    i++;

    }while(i<desired_value);

    for loop:

    for(int i=0;i<desired_value;i++)

    {

    //do something

    //put anything you want inside the the loop here

    }

    desired_value is any number you want.


  2. While (true) {

      echo "While loop!";

    }

    For ($i=0;$i>0;$i++) {

      echo "For loop!";

    }

  3. while (1) { foo(); }
You're reading: Source code for loop?

Question Stats

Latest activity: earlier.
This question has 3 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.