Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Random test
//gcc 5.4.0 #include <stdio.h> #include <stdlib.h> //Enables use of randoms int main(void) { int myRand; printf("Four rolls of a dice...\n"); // rand() % 6 yields 0, 1, 2, 3, 4, or 5 // so + 1 makes that 1, 2, 3, 4, 5, or 6 myRand = rand(); printf("Random Number = %d\n", myRand); printf("%d\n", ((myRand % 6) + 1)); myRand = rand(); printf("Random Number = %d\n", myRand); printf("%d\n", ((myRand % 6) + 1)); myRand = rand(); printf("Random Number = %d\n", myRand); printf("%d\n", ((myRand % 6) + 1)); myRand = rand(); printf("Random Number = %d\n", myRand); printf("%d\n", ((myRand % 6) + 1)); return 0; }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Generic Singly Linked List
signaling NaN test
-Wconversion double -> int
String copy
joseph a triangle
detonadisimo
Replacing Evens and Odd with ones and zeroes in a 3-Dimensional array
Newtons method
C_141210_Tartaglia
C_141210_Funciones
Please log in to post a comment.