In C language generate 1000 pseudo random numbers in the inclusive range [0..1000] , average them, find the variance, standard deviation, and send a message encoded using Morse code as a light encoded message with a SHA-1 hash.
As the random numbers are generated by an algorithm used in a function they are pseudo-random, Function rand() returns a pseudo-random number between 0 and RAND_MAX.
Average-
srand(time(0));
for (int i = 1; i < 51; i++) {
cout << 1 +(rand()%10) << endl;
}
Variance and standard deviation:-
var generator = new Random(1);
var draw = function() {
var num = generator.nextGaussian();
var standardDeviation = 60;
var mean = 200;
var x = standardDeviation * num + mean;
noStroke();
fill(214, 159, 214, 10);
ellipse(x, 200, 16, 16);
};
Get Answers For Free
Most questions answered within 1 hours.