Junior 3 (loop)

1. Write a program to display the first 10 natural numbers.

1 2 3 4 5 6 7 8 9 10

2. Write a program to display the multiplication table of a given integer.

Input the number (Table to be calculated) : 3

3 x 1 = 3

3 x 2 = 6

...

3 x 10 = 30

3. Write a program to display the n terms of odd natural number and their sum.

Input number of terms : 10

The odd numbers are : 1 3 5 7 9 11 13 15 17 19

The Sum of odd Natural Number upto 10 terms : 100

4. Write a program to display the pattern like right angle triangle using an asterisk. 

 

** 

*** 

**** 

5. Write a program to display the pattern like right angle triangle using an asterisk.

**** 

*** 

** 

*

6. Write a program to display the pattern like right angle triangle with a number. 

12 

123 

1234

7. Write a program to display the pattern like right angle triangle with a number. 

22 

333 

4444

8. Write a program to make such a pattern like right angle triangle with number increased by 1.

2 3 

4 5 6 

7 8 9 10

9. Write a program in to print the Floyd's Triangle. 

01 

101 

0101 

10101

10. Write a program to make such a pattern like a pyramid with an asterisk.

   * 

  * * 

 * * * 

* * * *

11. Write a program to display the n terms of even natural number and their sum.

Input number of terms : 4

The even numbers are : 2 4 6 8 

The Sum of even Natural Number upto 5 terms : 20

12. Write a C# Sharp program to count the string "UAH" in a given string.

Robot - 1000 UAH, Spaceman Table Lamp - 300 UAH, Headphones - 350 UAH

3

13. Write a program to check if the first appearance of "A" in a given string is immediately followed by "U".

Robot - 1000 UAH

True

Lamp - 300

False

14. Write a program to check whether the sequence of numbers 1, 2, 3 appears in a given array of integers somewhere.

Array: [4, 6, 1, 2, 3, 4, 5, 1]

True

15. Write a program in C# Sharp to display the n terms of harmonic series and their sum. 

1 + 1/2 + 1/3 + 1/4 + 1/5 ... 1/n terms

Input the number of terms : 5

1/1 + 1/2 + 1/3 + 1/4 + 1/5 

Sum of Series upto 5 terms : 2.28

16. Write a program to display the first n terms of Fibonacci series.

Fibonacci series 0 1 2 3 5 8 13 .....

Input number of terms to display: 10

Here is the Fibonacci series upto to 10 terms:

0 1 1 2 3 5 8 13 21 34