Skip to content

Instantly share code, notes, and snippets.

@binarykore
Last active May 10, 2024 19:09
Show Gist options
  • Select an option

  • Save binarykore/93481894e98e2e26fd706694afbef470 to your computer and use it in GitHub Desktop.

Select an option

Save binarykore/93481894e98e2e26fd706694afbef470 to your computer and use it in GitHub Desktop.
Random Wheel Generator using C Language..
#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