cstut9b - If (list[j] < list[minIndex]) To if...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
<stdlib.h> for rand( ), <time.h> for true randomness rand_int(1,365) gives random numbers from 1 to 365. size of array = 1000,but only fills up “numElem” random numbers. Using a function to fill up the array with random numbers from 1 to 365 Size of array = MAX, but only fills up “numElem” random numbers
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Selection sort program: arranges the array from smallest number to largest number To do from largest to smallest, change line 64
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: If (list[j] &lt; list[minIndex]) To if (list[j] &gt; list[minIndex]) To check same consecutive numbers in the array (must sort first), returns true if there are any duplicates of the same number. Using the program in main function: prints the probability of numElem people having same similar birthdays Have to multiple by 1.0 first to convert to double form...
View Full Document

Page1 / 2

cstut9b - If (list[j] &amp;amp;lt; list[minIndex]) To if...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online