Question
C# Programming
1-Write a program that generates the following sequence using while loop 2, 3,6,11, 18, 27,... 102 2-A. Repeat 1 using for lo
5. Using two nested for loops, generate the following 10 20 30 40 50 60 20 30 40 50 60 30405060 40 50 60 50 60 60 Notes:
0 0
Add a comment Improve this question Transcribed image text
Answer #1

\color{blue}\underline{1:}

using System;

public class WhileSequence
{
    public static void Main(string[] args)
    {
        int i = 2, inc = 1;
        while (i <= 102) {
            Console.Write(i + " ");
            i += inc;
            inc += 2;
        }

        Console.WriteLine();
    }
}

2 3 6 11 18 27 38 51 66 83 102 Process finished with exit code 0

\color{blue}as\;per\;guidelines\;we\;are\;only\;allowed\;to\;answer\;first\;program\\ Please\;make\;a\;separate\;post\;for\;remaining\;programs\\ Thanks

Add a comment
Answer #2

n=0

while n<=10:

    print(n*n+2, end='_')

    n=n+1

print()

print("Out of loop. Statements to execute after the expression evaluates to False")

print()

print()

print()


Add a comment
Know the answer?
Add Answer to:
C# Programming 1-Write a program that generates the following sequence using while loop 2, 3,6,11, 18,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • C# Help Please (Number one is below at the bottom) 1- Write a program that generates...

    C# Help Please (Number one is below at the bottom) 1- Write a program that generates the following sequence using while loop 2, 3 , 6, 11, 18, 27, … , 102 2- A.    Repeat 1 using for loop. B. Modify your program in A to skip 27 from that sequence. C. Modify your program in A by using break statement to stop generating the sequence if the generated number is greater than 30. 3. Using loops, find the value...

  • Help with c# code Write a program that generates the following sequence using for loop 2,...

    Help with c# code Write a program that generates the following sequence using for loop 2, 3 , 6, 11, 18, 27, … , 102 Using two nested for loops, generate the following 10 20 30 40 50 60 20 30 40 50 60 30 40 50 60 40 50 60 50 60 60

  • Lab 5-2 Nested Loops 2. Summation Of Numbers (using Nested While Loops) Part A: The program...

    Lab 5-2 Nested Loops 2. Summation Of Numbers (using Nested While Loops) Part A: The program will calculate and display the total of all numbers up to a specific number (entered by the user). Only positive numbers are allowed. Part B: User-controlled loop Part A Input Validation loop Part A: Summation loop Examples: When 5 is entered the program will calculate the total as 1+2+...+5 and display 15. When 2 is enterered the program will calculate the total as 1+2...

  • The answer need to write in C programming. QUESTION 2 Write a program using array to...

    The answer need to write in C programming. QUESTION 2 Write a program using array to generate a multiplication table based on the user's input. For example if user enter 5 as input then a multiply table for 1 to 5 is printed as output as shown in Figure Q2. There are three main steps in this program which are: Print rows (a) (b) Print columns Print multiplication of data inside table (c) Select C:\example1 \bin\Debuglexample 1.exe enter the value...

  • C++ any help is appreciated Program Pattern#2: Write a program that uses nested loop or for...

    C++ any help is appreciated Program Pattern#2: Write a program that uses nested loop or for statements to display Pattern A below, followed by an empty line and then another set of loops that displays Pattern B. Once again no setw implementation is allowed here but you must use nested loop or for statements with proper indentation to generate these patterns. Use meaningful variable identifier names, good prompting messages and appropriate comments for each loop segment as well as other...

  • Python pleases! Write a program that will produce the following table below. You will use a...

    Python pleases! Write a program that will produce the following table below. You will use a nested for loop and a duplicate nested while loop in one program. Note that this is the one through twelve multiplication table. Write the flowchart for the program. X 1 2 3 4 5 6 7 8 9 10 11 12 1 1 2 3 4 5 6 7 8 9 10 11 12 2 2 4 6 8 10 12 14 16 18...

  • Write a Python program (using a nested loop) to print out the following pattern (there is...

    Write a Python program (using a nested loop) to print out the following pattern (there is a space between the numbers next to each other). 1 2 1 3 2 1 4 3 2 1 5 4 3 2 1

  • Write a code using loop and flag function in python jupitior notebook: Ask the user for...

    Write a code using loop and flag function in python jupitior notebook: Ask the user for the number of items they bought. Also ask the price of each item they bought and quantity purchased. Display the total amount they owe. Ask the user for a number n. Calculate 1+2+3+….+n. Ask the user for a number n. Calculate 1*2*3*…*n. Ask the user for number of rows (r) and columns (c). Print * for r rows and c columns. Ask the user...

  • Write a complete C program that generate the following sequence of numbers in two ways. First,...

    Write a complete C program that generate the following sequence of numbers in two ways. First, the sequence of numbers should be made using a WHILE LOOP, then a DO-WHILE LOOP. 19, 15, 11, 7, 3, -1, -5, -9

  • C++ program Write a program which: 1. Enters data into the 2D array of integers which...

    C++ program Write a program which: 1. Enters data into the 2D array of integers which is 5x5 The data should be entered with an assignment statement using nested for loops that is do not scan in the data. The data should be: 1 2 4 8 16 1 3 9 27 81 1 4 16 64 256 1 5 25 125 625 1 6 36 216 1296 2. Print out the following using a nested for loop Row 0:...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT