Current location - Quotes Website - Personality signature - How to make a roll-call lottery device for class lottery with C language
How to make a roll-call lottery device for class lottery with C language
If the number is randomly selected, the owner of the number can print it out with switch case.

# include & ltstdio.h & gt

# include & lttime.h & gt

# include & ltstdlib.h & gt

int main()

{

int a = 0;

Srand ((unsigned) time (empty));

a = rand()% 40+ 1; /* Select one from 1 to 40 */

printf("%d\n ",a);

Returns 0;

}