---
title: "Write a c# program to print 1 to 100 in format using any single loop?"  
description: "Write a c# program to print 1 to 100 in format using any single loop?"  
author: "Steilla Mitchel"  
published: 2021-11-15  
updated: 2021-11-15  
canonical: https://www.mindstick.com/forum/156840/write-a-c-sharp-program-to-print-1-to-100-in-format-using-any-single-loop  
category: "c#"  
tags: ["c#"]  
reading_time: 2 minutes  

---

# Write a c# program to print 1 to 100 in format using any single loop?

Write a c# [program to print](https://www.mindstick.com/forum/157407/javascript-program-to-print-all-prime-number-between-two-intervals) 1 to 100 in [format](https://www.mindstick.com/forum/162083/how-to-convert-ost-files-into-pst-format) using any single loop?

## Replies

### Reply by Ashutosh Kumar Verma

Following is a [C# program](https://www.mindstick.com/forum/156830/how-do-i-make-a-c-sharp-program-that-checks-for-given-array-by-user-which-elements-are-perfect-numbers) to [print 1 to 100](https://www.mindstick.com/forum/156826/how-to-print-1-to-100-number-without-using-any-number) number in format of 1 11 21.. using a single loop.

## Program:

```
using System;
class HelloWorld {
  static void Main() {
    int i=1;
    int j=1;
    while(i<=100)
    {
        if(i%10==0)
        {
            Console.WriteLine('  '+j);
            j++;
            j=j-100;
        }else
        {
            Console.Write('  '+j);
        }
        j=j+10;
        i++;
    }
  }
}
```

## Output:

```
1       11      21      31      41      51      61      71      81      91
2       12      22      32      42      52      62      72      82      92
3       13      23      33      43      53      63      73      83      93
4       14      24      34      44      54      64      74      84      94
5       15      25      35      45      55      65      75      85      95
6       16      26      36      46      56      66      76      86      96
7       17      27      37      47      57      67      77      87      97
8       18      28      38      48      58      68      78      88      98
9       19      29      39      49      59      69      79      89      99
10      20      30      40      50      60      70      80      90      100
```

## \


---

Original Source: https://www.mindstick.com/forum/156840/write-a-c-sharp-program-to-print-1-to-100-in-format-using-any-single-loop

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
