Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n, max=0, c;
- cout<<"n="; cin>>n;
- while(n!=0)
- {
- c=n%10;
- if(c>max)
- max=c;
- n=n/10;
- }
- cout<<"Cea mai mare cifra este "<<max;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment