Question: Please answer for the C programming language. How can I make it so that I get different values each time the getRandomNumber function is called?

Please answer for the C programming language. How can I make it so that I get different values each time the getRandomNumber function is called? Each time it is called I get the same values and can not figure out how to get different values for each iteration of the for loop.

Please answer for the C programming language. How can I make itso that I get different values each time the getRandomNumber function is

main.c (Ctrl+M) monsterbattle.c: monsterbattle.h! 1 #include #include 3 #include 4 #include "monsterbattle.h" 5 6- int getRandomNumber(int min, int max) { 7 int num; srand(time(NULL)); 9 rand()%(max-min+1) + min; 10 printf(" Min: %d, Max:%d, Rand generated: %d ",min, max, num); 11 return num; 000 W NP num = 12 13} 14 15 void fillRooms (Room *rooms, int length) { 16 int i; 17 - for(i = 0; i

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!