Run Code
|
API
|
Code Wall
|
Users
|
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
Please
log in
to post a comment.
C programming final grade
Project 3 Part 1 v2
linkedlist
C141106_TablaMultiplicar
Project 3 Part 1 v1.0
Matrices de cadenas con *punteros
Practica 5 fibonacci
print_odd_pointer.c
If Statement/ Decrements V2
REGISTRO EN C
Please log in to post a comment.