marrioncu17
marrioncu17 marrioncu17
  • 26-02-2018
  • Computers and Technology
contestada

write a for loop that displays the following set of numbers: 0,10,20,30,40,50....1000

Respuesta :

Rodiak
Rodiak Rodiak
  • 07-03-2018
C# program code:

int i = 0
while (i<=1000)
{
console.Writeline("{0}",i);
i = i + 10;
}

Explanation:
First we set variable to initial value. In this example it is 0. Then we enter into while loop. This type of loop executes the code until the condition is fulfilled. In our case while loop checks if i <=1000. It is and then it writes it on the screen. Next step is to increase it by 10. Then it does the same code again.
Last number that will be printed is 1000. After that it will increase i to 1010 and it will exit the loop.
Answer Link

Otras preguntas

What was the West to many Americans during the turn of the 19th century? a) a place of opulence b) a place of oppurtunity c) a place of deprivation d) a place o
In an election, 11 of 20 voters preferred Ms. Williamson to Ms. Stallings. A total of 3300 people voted in the election. How many voters preferred Ms. Williamso
can you help me on areas problem 1
Solve : 5x - 7y = 12 5y - 2x = - 7
What are the missing numbers ?, 3.2, 2.4, ?, 0.8
Where did Abraham Lincoln die?  Who killed him?
choose an antonym for gargantuan A.literary B.dainty C.moderate D.carnivorous E.enormous
if a figure is a square then it is a regular quadrilateral is this true or false explain
how do we get .375 into a percent
During eukaryotic transcription,an RNA molecule is formed that is? A. complementary to both strands of DNA B. identical to an entire single strand of DNA C. dou