programe to randomly generate store and display the age of N studnets (e.g ,18,24,38 etc).the minimum age is 18 and maximum age is 75.N should be equal to 9.
1.How we can intialise all the elements of the array to -1.
2.Randomly generate and store the age of N studnets .
3.sort and display the array in ascending order .
thnks :-)
alex k
0
Newbie Poster
Recommended Answers
Jump to Post1. use a loop
2. call
srand( (unsigned int)time(0));
to initialize the random number generator, then for each number callrand()
to get a random number.3. google for sort algorithms. The bubble sort is the easiest to code but the slowest. In c++ you can also use …
All 3 Replies
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
alex k
0
Newbie Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.