Last active
May 10, 2024 19:09
-
-
Save binarykore/93481894e98e2e26fd706694afbef470 to your computer and use it in GitHub Desktop.
Random Wheel Generator using C Language..
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <time.h> | |
| void delay(int nos){ | |
| int ms = 1000 * nos; | |
| clock_t st = clock(); | |
| while(clock() < st + ms); | |
| } | |
| int main(){ | |
| int i, n, ml = 150; | |
| int winners = 7; | |
| time_t * t; | |
| srand((unsigned) time(t)); | |
| printf("Lucky Giveaway Winners: %d\r\n",winners); | |
| for(i = 0;i < winners;i++){ | |
| printf("Winner [%i]: %d\r\n",(i+1),rand() % ml + 1); | |
| delay(2000); | |
| } | |
| printf("Congrats to these Winners..\r\n"); | |
| return(0); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment