Skip to content

Commit 5cb5c7e

Browse files
Add files via upload
1 parent 882b4fb commit 5cb5c7e

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

DSB.C

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#include <stdio.h>
2+
#include <dos.h>
3+
#include <conio.h>
4+
#include <stdlib.h>
5+
#include <time.h>
6+
7+
void delay(unsigned int mseconds) {
8+
clock_t goal = mseconds + clock();
9+
while (goal > clock());
10+
}
11+
12+
int main() {
13+
int numberOfPorts;
14+
15+
printf("\nInitializing DSB... \n");
16+
delay(3 * CLOCKS_PER_SEC);
17+
printf("\nInitialization successful! \n");
18+
delay(1 * CLOCKS_PER_SEC);
19+
printf("\nDetecting USB ports...\n");
20+
delay(3 * CLOCKS_PER_SEC);
21+
22+
srand(time(NULL));
23+
numberOfPorts = (rand() % 10) + 1;
24+
25+
printf("\n%d %s\n", numberOfPorts, "USB ports found\n");
26+
27+
return 0;
28+
}

0 commit comments

Comments
 (0)