Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
C# Truly Random
//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; using System.Security.Cryptography; namespace Rextester { public class Program { public static void Main(string[] args) { RNGCryptoServiceProvider rngCsp = new RNGCryptoServiceProvider(); int y = 10; byte[] randomNumber = new byte[25]; rngCsp.GetBytes(randomNumber); int x = 0; for(int i=0;i<randomNumber.Length;i++){ Console.WriteLine("Posição: " + (i+1) + " Valor: " + randomNumber[i]); x += randomNumber[i]; } Console.WriteLine("######################"); Console.WriteLine("Total: " + Convert.ToInt32(x)); } } }
run
|
edit
|
history
|
help
2
ASXs
How to find second largest integer in an array using only one loop?
Display the pattern like diamond by using c# for loop
s
UriParts
edszfcfsefer
AnonymousFunction (demo)
Sum Matrix Row
Update 2D Array
Fibonacci of array elements C#