I can't really get my rand function to print the winner correctly from my array. Can someone really help?
As an Array can only be accessed using an INTEGER
you will have to
and on top of that you will have to use the
See you have to get the rand number by using the rand() and you have to access the rand winner by just calling out the array().Nothing big deal,it's quite cool if you look into this deeply.Hope my below code give you a right perception.
// Create an array and push on the names
// of your closest family and friends
// Sort the list
// Randomly select a winner!
// Print the winner's name in ALL CAPS
After running your code also i am getting an error message as Remember to print out the name of the lucky winner!
Thanks a lot!
I realised I did't have to make another variable here:
So do I!joy:joy:joy: