We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 882b4fb commit 5cb5c7eCopy full SHA for 5cb5c7e
DSB.C
@@ -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
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