« home | Almost... » | 1 more week. » | Why? » | Who's ur daddy??? » | oooohhh » | 0230... » | Its 2.20am » | Catch me if you can. » | chem engineers » | Bad English »

Sum of random numbers...

clear all
totalsum=0
for b=rand(1,100)
if b>0.5
totalsum=totalsum+b;
end
end
sprintf('The total sum of the random numbers greater than 0.5 in a randomly\ngenerated array of 100 elements is %g',totalsum)

MWAHAHAHHAAHAHA



Leave a comment




« close »



Leave a comment




« home »

Contribute

Archives