Strong Number:
Strong number is a special number whose sum of the factorial of digits is equal to the original number.
for example:
145=1! + 4! + 5!
=1+4*3*2*1+5*4*3*2*1
=1+24+120
145=145, hence proved.
Here, we done it in the mathematical form . now, we are gonna do it in the program.
Program:
class Strong{
public static void main(String args[]){
int n=145;
int copy=n;
int pop=0;
int sum=0;
int fac;
while(n>0){
fac=1;
pop=n%10;
while(pop>0){
fac=fac*pop;
pop–;
}
sum=sum+fac;
n=n/10;
}
if(copy==sum){
System.out.println(“strong”);
}
else{
System.out.println(“not strong”);
}
}
}
output:
sobhika@sobhika-HP-Laptop-15-db1xxx:~$ javac Strong.java
sobhika@sobhika-HP-Laptop-15-db1xxx:~$ java Strong
strong
sobhika@sobhika-HP-Laptop-15-db1xxx:~$
GCD (GCD (Greatest Common Divisor)
GCD (Greatest Common Divisor) of two given numbers A and B is the highest number that can divide both A and B completely, i.e., leaving remainder 0 in each case.
example:

Program:
class GCD{
public static void main(String args[]){
int n=8;
int m=12;
int min=n>m?n:m;
while(min>1){
if(n%min==0){
if(m%min==0){
System.out.println(min);
break;
}
}
min–;
}
}
}
output:
sobhika@sobhika-HP-Laptop-15-db1xxx:~$ javac GCD.java
sobhika@sobhika-HP-Laptop-15-db1xxx:~$ java GCD
4
sobhika@sobhika-HP-Laptop-15-db1xxx:~$