Ask Question
9 February, 22:10

How to Create a while loop

+5
Answers (2)
  1. 9 February, 22:25
    0
    For C/C + +, C# for while loop has the same layout.

    while (/*condition*/)

    {

    / / TO DO

    }

    for e. g:

    int main ()

    {

    int sum = 0, i = 0;

    //While loop

    while (i < = 100)

    sum + = i++;

    printf ("Sum %d", sum);

    getchar ();

    return 0;

    }

    This code will sum from 0 to 100 (Sigma from x = 0 to 100 of x)
  2. 9 February, 22:32
    0
    While (condition) ( = = !+)

    {

    code block

    }

    some think like this
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “How to Create a while loop ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers