In addition to what above poster is saying, you need to seed the random number generator using srand().
Thanks so much for your replies:
Infarction, actually, i just wrote a sample code that i was trying.
So, sorry for the typos, yes its <10 instead of <12.
# If the sum gets over 1 before i use all the ten numbers then this would be invalid case.
I have to make sure that all 10 numbers are used and that no number is given a value of 0
# I will be saving random numbers that i am generating.
# Ok, i will not use not1 in while loop, instead will use the condition itself
MAIN PROBLEM NOW IS THAT SIMULATOR RUNS FOR EVER BECAUSE THIS CONDITION IS NOT BEING MET
sum < 1 && sum > 0.75
So, if someone has better idea of how this can be done in small time.
Thanks
manu