random numbers
Please, I need code to generate random numbers using the middle square
method, congruence method and the arithmetic congruence method. I want
the codes in console application.Thanks
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Feb 21, 2013, 9:27 AM
http://www.c-sharpcorner.com/forums/thread/137073/random-numbers.aspx
As for the 'middle-square method', here's an implementation of that using a six digit seed:
using System;
harsha rajuPosted Jun 27, 2014, 6:49 AM
please provide the code for generating random numbers using mid square method
thanks,...
Upamanyu Roy ChoudhuryPosted Feb 21, 2013, 4:19 AM
Use Random class to generate random number.
Random integer between 0 and 100 (100 not included):
You may also find the following link as useful
http://www.dotnetperls.com/random
Keep me posted.
Random random = new Random();int randomNumber = random.Next(0, 100);
MessageBox.Show(randomNumber.ToString());