Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int maxmin(int n)
- {
- int i,cifra,maxi=0;
- for(i=1;i<=n;i++)
- {
- cifra=n%10;
- maxi=cifra;
- if(cifra>maxi) maxi=cifra;
- n=n/10;
- }
- return maxi;
- }
- int main()
- {
- int n;
- scanf("%d",&n);
- printf("%d",maxmin(n));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement