C# Loop Programming Examples

example
In this chapter you will learn:

In this chapter you will learn how to implement loop constructs in C# programming. There are some programming examples are given below that will help you to understand loop constructs in C#.

Qu 1: Write a program to display table of given number.
Answer:

Output

Enter a number     8
8 x 1 = 8
8 x 2 = 16
8 x 3 = 24
8 x 4 = 32
8 x 5 = 40
8 x 6 = 48
8 x 7 = 56
8 x 8 = 64
8 x 9 = 72
8 x 10 = 80
__

 

Qu2: Write a program to print following output using for loop.
1
22
333
4444
55555
Answer:

Output

1
22
333
4444
55555
__

Summary

In this chapter you learned how to implement loop constructs in C# programming. In next chapter, you will get some
programming exercises. You must do all the exercises in order to improve your programming skills in loop constructs.


13 thoughts on “C# Loop Programming Examples”

  1. Any one can print this program if yes plz send the code to me —> vp554654@gmail.com

  2. 2

    **

    **

    3

    ***

    *-*

    ***

    4

    ****

    *–*

    *–*

    ****

    5

    *****

    *—*

    *—*

    *—*

    *****

    6

    ******

    *—-*

    *—-*

    *—-*

    *—-*

    ******

    7

    *******

    *—–*

    *—–*

    *—–*

    *—–*

    *—–*

    *******

    8

    ********

    *——*

    *——*

    *——*

    *——*

    *——*

    *——*

    ********

Leave a Reply

Your email address will not be published. Required fields are marked *