Using Time Function !?

I am confused !

Please help me to solve this question ...



Q: Use the time function from this code to generate 5 Beeps every 10 Seconds for 3 Times.


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
#include<iostream>
#include<cstdlib>
#include<ctime>
using namespace std;
int main()
{
	srand(time(0));
	int number=rand()%100+1;
	int guess, tries(1);
	
	cout<<"Im thinking of a number between 1-100. Take a guess: ";
	cin>>guess;
	
while(guess!=number)
{
	tries++;
	
	if(guess>number)
		cout<<"Too high,Guess again: ";
	
	else
		cout<<"Too low, Guess again: ";
		cin>>guess;
}
cout<<"Congrats!! You got it after "<< tries << " tries." <<endl;


return 0;
}




Thank You :)
Last edited on
I see no time function in that code. Are you sure you posted the correct example?

Don't care about the code.


I want only to know How To generate 5 Beeps every 10 Seconds for 3 Times ??


Last edited on
Topic archived. No new replies allowed.