main(int argc, char *argv[]) { long n; while(--argc) { int i; n = atol(*++argv); i = bit_count(n); printf("%ld contains %d bit%s set\n", n, i, plural_text(i)); } return 0; }
main(int argc, char *argv[]) { int i, n = argc - 1; printf("You passed %d argument%s on the command line.", n, plural_text(n)); if (argc > 1) { puts(" They are:"); for (i = 1; i < argc; ++i) { printf("\nArgument #%d:\n Text: \"%s\"\n Value: %d\n", i, argv[i], atoi(argv[i])); } } else putchar('\n'); return 0; }