Answer:
#include
#include // Enables use of rand()
#include // Enables use of time()
int main(void) {
int seedVal = 0;
seedVal = 4;
srand(seedVal);
cout<< rand()%(int)(149-100+1) + 100;
cout<< rand()%(int)(149-100+1) + 100;
return 0;
}
Explanation:
The code segment starts at line 8 and ends at line 9.
That is:
cout<< rand()%(int)(149-100+1) + 100;
cout<< rand()%(int)(149-100+1) + 100;
The syntax for generating random values in C using rand function is
rand()%(int)(max - min + 1) + min
Or
min + rand()%(int)(max - min + 1).
It works both ways..
Where max and min represent the range of values needed (maximum and minimum)
The random statement can also be used in loops