//Rextester.Program.Main is the entry point for your code. Don't change it.
//Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
namespace Rextester
{
public class Program
{
public static void Main(string[] args)
{
Random rnd = new Random();
decimal value = rnd.Next(100000000, 999999999);
Console.WriteLine(value);
}
}
}
//Rextester.Program.Main is the entry point for your code. Don't change it.
//Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
namespace Rextester
{
public class Program
{
public static void Main(string[] args)
{
Random rnd = new Random();
decimal value = rnd.Next(10000, 99999);
Console.WriteLine(value * value);
}
}
}
لتوليد تسعة ارقام عشوائية باستخدام النوع decimal او double
كما في المثال الأول
لتوليد عشرة ارقام عشوائية استخدم الكود الثاني
تأكد من صحة الكود على الرابط http://rextester.com/