Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main (int argc, char** argv) {
- int broj, brojCifara=0, min=9, max=0;
- printf("Ulaz: ");
- scanf("%d", &broj);
- if (broj < 0) broj = -broj;
- while (broj > 0) {
- brojCifara++;
- if ((broj % 10) < min) min = broj%10;
- if ((broj % 10) > max) max = broj%10;
- broj /= 10;
- }
- printf("Broj cifara: %d", brojCifara);
- if (brojCifara%2) printf(" min: %d", min);
- else printf(" max: %d", max);
- getchar();
- getchar();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement