fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. int p[100];
  5. int z = 0;
  6. for (int x = 100; x > 1; x--) {
  7. for (int n = 2; x % n != 0; n++) {
  8. if (n == x - 1) {
  9. p[z++] = x;
  10. break;
  11. }
  12. }
  13. }
  14. while (z >= 0) printf("%d ", p[z--]);
  15. }
  16.  
  17. //https://pt.stackoverflow.com/q/344054/101
Success #stdin #stdout 0s 9424KB
stdin
Standard input is empty
stdout
0 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97