Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- //Create a program to ask the user for two numbers and display the numbers between them (both included), three times: using "for", using "while" and using "do..while"
- //Enter first number: 6
- //Enter last number 12
- //6 7 8 9 10 11 12
- //6 7 8 9 10 11 12
- //6 7 8 9 10 11 12
- class RepetitiveStructures
- {
- static void Main()
- {
- int firstNumber = int.Parse(Console.ReadLine());
- int secondNumber = int.Parse(Console.ReadLine());
- for (int column = 1; column <= 3; column++) // draws the columns
- {
- for (int line = firstNumber; line <=secondNumber; line++) //fills in the rows with numbers
- {
- Console.Write("{0} ", line);
- }
- Console.WriteLine(); // interval at the end of each line
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement