Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Collatz(3k+1)
#include <stdio.h> #include <stdlib.h> #include <time.h> int main(void) { unsigned int n; time_t t; srand((unsigned) time(&t)); n = rand() / 3; if (n > 1) { while (n > 1) { printf("%10u \n", n); if ((n % 2) == 0) { n = n / 2; if (n == 1) printf("%10u", n); } else n = 3 * n + 1; } } else printf("%u", n); return 0; }
run
|
edit
|
history
|
help
0
Stub Program for Problem 3 HW 2
time.c
Practice
if (strcmp(abb, "lol")==0 || strcmp(abb, "LOL")==0 || )
eliminate_duplicates.c
CharacterInput
B_141209_TrianguloTartalia
quadsort vs qsort
C_141211_OrdenarArrayConFunciones
FahrenheitToCelciusReverse