I need help on a c program that randomly generates a 7 digit
I need help on a c++ program that randomly generates a 7 digit login. It does the same thing after a certain time period has gone past (i.e after 30 seconds it runs through the loop again)
Solution
#include<iostream>
 #include<ctime>
 int main()
 {
 int n;
 int i=1;
 clock_t start,end;
 srand(time(NULL));
 while(i<=30)
 {
 start=clock();
 n=rand()%1000000+1;
 cout<<\"login:\"<<n;
 abc:
 end=clock();
 if(!((end-start)*1000>=30.0))
 goto abc;
 i++;
 }
 return 0;
 }

