More Random Numbers Help

I am a computer science 1 student and am kinda stuck on my program. The program is called "Guessing Numbers" and is a simple little game of guess the number. My problem is I am not sure how to make the variable "Number" be random every time the loop runs.
How do I make "Number" randomize itself each time the loop runs?
Thanks in advance.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <string>

using namespace std;



int main()

{

	srand (time(0));
	
	int Guess;
	int Attempts;
	int Number = rand()%4 + 1;
	int Wrong = 0;
	int Right = 0;
	
	
	do
		for (Attempts = 0; Attempts < 4; Attempts++) 
		
		{
		cout << " I am thinking of a number from 1 to 4 can you guess what number it is?" << endl;
			cin >> Guess;



			if (Guess == Number)
				{
					cout << "Congratulations you guessed  my number!" << endl;
					Right++;
				}		
			
			else
				{
					cout << "WRONG" << endl;
					Wrong++;
				}
				
		}
		while ( Attempts < 4 );

		cout << "You guessed " << Wrong << " wrong and " << Right << " right" << endl;
		 


system ("pause");
return 0;

}
put Number = rand()%4 + 1; inside the loop
Wow that was an easy fix. Maybe I need to step away for a few minutes, I'm not thinking clearly.
Thanks for your help.
Topic archived. No new replies allowed.