C Code:
#include <stdio.h> // Enables use of printf
#include <stdlib.h> // Enables use of rand()
#include <time.h> // Enables use of time()
int main(void)
{
srand(time(0));
int random1 = rand()% 50 + 100;
int random2 = rand()% 50 + 100;
printf("%d\n", random1);
printf("%d\n", random2);
return 0;
}
Output:
115
141
Explanation:
Each time program executes, srand() function generates new random numbers.
rand()%50 + 100 makes sure that number is 2 digit and within the range of 100 to 150.
Then we print the two random numbers where %d represents that we want to print an integer and \n represents new line