1- #include<iostream.h>

2- #include<conio.h>

3- void main()

4- {

5- int num, a, b, c, d, mod;

6- cout<<"Enter Four Digit Number\n";

7- cin>>num;

8- a=num/1000;

9- mod=num%1000;

10- b=mod/100;

11- mod=mod%100;

12- c=mod/10;

13- mod=mod%10;

14- d=mod;

15- if(a>b && a>c && a>d)

16 cout<<" The Digit "<<a<<"is Greater\n";

17- else if(b>a && b>c && b>d)

18- cout<<" The digit "<<b<<"is Greater\n";

19- else if(c>a && c>b && c>d)

20- cout<<"" The digit "<<c<<"is Greater\n";

21- else

22- cout<<"The Digit "<<d<<"is Greater\n";

23- getch();

24- }

OUTPUT

Enter Four Digit Number

4567

The digit 7 is Greater