sunfenglin0325
sunfenglin0325 sunfenglin0325
  • 18-04-2017
  • Computers and Technology
contestada

how to Create a while loop

Respuesta :

prakash12
prakash12 prakash12
  • 18-04-2017
while (condition) ( < > =< => = !+) 
{
    code block
}

some think like this 

Answer Link
TheHero
TheHero TheHero
  • 18-04-2017
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)


Answer Link

Otras preguntas

The judicial branch that we know today was established________________.
What are some things Jonas begins to perceive and eventually begin to "see"
A difference between coelomates and pseudocoelomates is that A. one has bilateral symmetry and one does not. B. pseudocoelomates have a true coelom. C. the g
If LMN is dilated by a scale factor of 0.5, which of the following statements is not true? A. The sides of LMN are congruent to the sides of L'M'N'. B.
x^(2) + 10x=24 by completeing the square
PLEASE HELP ME! Your repeat customers have made it clear that quality is more important than price. This reflects your target market's A. distinguishing c
6 cubed x 6 to the power 4
what is australia's value system
What is the probability that a female child of Charles and Marie would suffer from hemophilia?
What is resonance? How is the velocity of sound in air determined by resonance tube method?