fork download
  1. #include <stdio.h>
  2.  
  3. #define IMPOSSIBLE_VALUE 42
  4. int print_int_with_blank(char const *pre, int value, char const *post) {
  5. int n = 0;
  6. if (value != IMPOSSIBLE_VALUE) {
  7. n = printf("%s%d%s", pre, value, post);
  8. }
  9. return n;
  10. }
  11.  
  12. int main(void) {
  13. int a[10];
  14. for (int i = 0; i < 10; i++) {
  15. a[i] = 7 * i;
  16. }
  17. print_int_with_blank("", a[0], "");
  18. for (int i = 1; i < 10; i++) {
  19. print_int_with_blank(", ", a[i], "");
  20. }
  21. puts("");
  22. }
  23.  
  24.  
Success #stdin #stdout 0s 9424KB
stdin
Standard input is empty
stdout
0, 7, 14, 21, 28, 35, 49, 56, 63