output - How do I display a row of random numbers in C# instead of a column? -


here program:

using system; using system.collections.generic; using system.linq; using system.text;  namespace consoleapplicationlotto {     class program     {         const int limit = 7;          static void main(string[] args)         {             int[] lotto = new int[limit];             int lotdigits;              random rnd = new random();              foreach (int sub in lotto)             {                 lotdigits = rnd.next(0, 8);                 console.writeline(lotdigits);              }           }     } } 

i want display 7 random digits in row forming 7 digit "lotto number", "5902228" instead of:

5

9

0

2

2

2

8

i tried using "0:d7" , gives me bunch of zeroes last few digits being other numbers.

use console.write instead of console.writeline


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -