Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Need some help with spacing

c#

This topic has been archived. This means that you cannot reply to this topic.
No replies to this topic

#1 fbla2

fbla2

    CC Lurker

  • Just Joined
  • Pip
  • 1 posts

Posted 10 December 2015 - 07:31 PM

Ok, so I have tried already and this is what I got so far and I was wondering how to make the program start on a new line after every 20 ID's

using System;
public class DebugFour3
{
    public static void Main()
    {
        char letter='A';
        int number;
        const int LOW = 0;
        const int HIGH = 99;
        const int NUMINROW = 20;
        for (letter = 'A'; letter <= 'Z'; ++letter)
            for (number = LOW; number <= HIGH; ++number)
            {
                if (number % NUMINROW == 0)
                    Console.WriteLine();
                 Console.Write("{0}{1} ", letter, number.ToString("D2"));
            }
        Console.ReadLine();
    }
‚Äč}

Edited by fbla2, 10 December 2015 - 07:32 PM.