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

How can you tell a linking verb from an action verb?
there are 12 rabbits in a cage. the ratio of white rabbits to all rabbits is 3:4. how many white rabbits are in the cage
What is 3/14 times 7/9 times2/7
: determine the genotype and phenotype of the offspring from following crosses1.A homozygous purple flower plant and a heterozygous purple flower plant.2.A homo
In the new cities of the 1800s, streetcars were to the suburbs and residential neighborhoods as glass and steel were to A. palatial mansions of the rich. B. f
Like many forms of substance abuse, alcoholism develops through stages. Which of the following stages is the most advanced and the most difficult to recover fro
2³¹ + 2³⁰ + 2²⁹ = x · 2²⁸x=?
Can someone plz tell me 35% as a decimal ?
write the following in short (index) form b x b x b x b x b x b
what are 3 important ideas in the declaration of independence?