Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- main()
- {
- int br, a, b, c, pom;
- printf("Unesite trocifreni broj: \n");
- printf("\tBroj : ");
- scanf("%d", &broj);
- a=broj/100 ;
- b=(broj%100)/10 ;
- c=broj%10 ;
- if (a<b)
- pom=a;
- a=b;
- b=pom;
- if (a<c)
- pom=a;
- a=c;
- c=pom;
- if (b<c)
- pom=b;
- b=c;
- c=pom;
- broj=a*100+b*10+c;
- printf("Najveci trocifreni broj je -> %d\n", broj);
- getch();
- }
Add Comment
Please, Sign In to add comment