Java? ????? ??? ??? ?? ??? ?????. ??? ?? ???? ???? ????? ????. Java??? ?? ??? ???? ??? ? ????. ??? ??? ?? ??? ??? ??? ??? ??? ??? ???? ??? ? ????. Java??? ??? ??? ???? ???? ?? ? ????. ????? ???? ? ???? ?? 10? ?? ???, ????? ? ??? ?? ?????. ??? ?? ??? ?? ??? ??? ??? ? ????.
?? ????? ?? ?? ??
? ??, ????? ??, ????? ??? ?
???? ??
?? ???? ??? ?? ?? ??? ??? ?? ???????.
???? ?? ??? ?? ?????. ??, ??? ??? ???? ??? ?? ?? ?? ??? ??? ?? ??? ?? ???? ???. ??? ?? ??? ??? ??? ??? ??? ????? ?? ? ??, ??? ?? ??? ??? ?? ??? ??? ??? ??? ??? ?? ? ????. ??? ??? ????. ???? ?? ???????. ??? ??? ?? ??? ????? ?? ? ????.
8? ????? ??? ???? ??? ??? ?????.
- ?? ???? ??? 1, 2, 4, 8? ????. ?? 8? ??? ?? ??? ????? ??? 7? ???. ?? ??? ??? ??? ?????. ??? ?????. ? ??? ?? ????. ?, ? ??? ???? ???? ?? ? ????.
- ?? ? ?? ??? 6? ??? ?????.
- 6? ??? 1, 2, 3, 6? ?????.
- ?? ??? ?? 6? ??? 6???.
- ?? ??? ??? ??? ??? ???. ???? ??? ??? ?????. ??? ?????. ?, ??? ??? ????? ?? ? ????.
Java?? ???? ???? ??? ??????
?? ??? ?? ??? java? ???? ??? ???????. ?? ???????? ???? ???? ??? ??? ?? 3??? ????.
1.? while ??? ????
while ????? ??? ?? ? ?? ??? ???? ???.
1. ?? ???? ??? ??? ??? ???.
2. ??(j
3. ?? ?? no=8, j=1 no/2=4??? j <=4? ??? true?? ?????. ?? ??? ????.
8%j=0 true?? ?? =1
J=2 2<4? ??? 8%2 =0? ??? ?= 1+3=3???.
??? ???? ?? ??? ???? ???? ????.
2. ?? ??? ????
? ?????? ?? ???? ???? ???? ??? ? ????. ? ?????? PerfacOrNot ???? ???? ???. ?? ???? ??? ?? ???? ???? ??? ??? ???? ??? ?????.
3. ?? ???? ????
? ?????? ??? ???? PerfectOrNot() ???? ?????. ? ?????? ??? ????? ???? PerfectOrNot()? ?????. j
?
?? ??? ?? Java?? ???? ??? ?? ???????.
?? #1
??:
import java.util.Scanner; class Perfect_number1 { public static void main(String arg[]) { long num,s=0; Scanner s_c=new Scanner(System.in); System.out.println("Enter number"); num=s_c.nextLong(); int j=1; while(j<=num/2) { if(num%j==0) { s+=j; } j++; } if(s==num) { System.out.println(num+" the given number is perfect number"); } else System.out.println(num+" the given number is not perfect number"); } }
??
? ????? ???? while ??? ???? Java?? ???? ??? ???. ? ????? ??? ?? ?????. ???? ?? ???? ??????. ?? ??? ??? ??? ??? ???? while ??? ???? ??? ??? ??? ?? ? ????? ??? ?? ??? ??? s ??? ?? ??? ?????. ????? ? ??? ???? ??? ?? ???? ?????. ? ????? ?? ??? ?? ????? ???? ?????.
?? #2
?? ??? ?? ?? ???? ???? ???? ? ?? ?? ???????.
??:
import java.util.Scanner; class Perfect_Method { public static void main(String arg[]) { long num,m; Scanner s_c=new Scanner(System.in); System.out.println("Enter number"); num=s_c.nextLong(); m=perfectOrNot(num); if(m==num) System.out.println(num+" The given number is perfect number"); else System.out.println(num+" The given number is not perfect number"); } static long perfectOrNot(long n) { long s=0; for(int j=1;j<=n/2;j++) { if(n%j==0) { s+=j; } } return s; } }
??
In the above program, we use a static method to check if a given number is a perfect number or not. In the above program, we use the perfecOrNot () method. After that, we use a for loop to find the factors of the given number, and the remaining process is the same, that is, to compare the result with the given number and print a message according to the comparison. The final output of the above program we illustrate by using the following screenshot as follows.
Example #3
Now let’s see another example to check perfect numbers by using the recursive Method as follows.
Code:
public class Recursive { static int n = 200; static int s = 0; static int d = 1; static int findPerfect(int n, int d) { { if(d<=n/2) { if(n%d==0) { s+=d; } d++; findPerfect(n,d); } return s; } } public static void main(String args[]) { int r = findPerfect(n,d); if(r == n) System.out.println(" The given number is perfect Number"); else System.out.println("The given number is not perfect Number"); } }
Explanation
In the above program, we are using a recursive method to check the perfect number. The final output of the above program we illustrate by using the following screenshot as follows.
Conclusion
We hope from this article you learn Perfect Number in java. From the above article, we have learned the basic logic of Perfect Numbers, and we also see different examples of Perfect Numbers. From this article, we learned how and when we use the Perfect Number in java.
? ??? ??? ???? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

JavaScript??? ?? ??? ?? ??? ? ??? ???? ??? ???? ?? ??? ?? ??? ???????. 1) ?? ??? ??? ??? ???? ???? ??? ??? ?? ? ?? ????. 2) ?? ?? ??? ?? ??? ?? ? ? ????? NAN? ??? ??? ?????. 3) ?? ? ??? ?? ?? ??? ?????? ?? ??? ? ???? ?????.

JavaScript ??? ??? ???? ???? ???? ???? ??? ?????. 1. ??? ?? ??, 2 ??? ??? ??, 3. ??? ???? ??????. ??? ???? ?? ??? ?? ??? ??? ???? ????? ?????.

JavaScript? ???? ??? ???? ???? Crypto-JS ?????? ??? ? ????. 1. Crypto-JS ?????? ???? ??????. 2. ??? ? ?? ??? ?? AES ????? ???? ??? ?? ?????????. 3. ?? ?? ?? ? ?????????. CBC ??? ?? ??? ???? ?? ???? ?? ????. 4. ???? ??? ? ? ??? ???? ?? ??????. 5. ASCII? ?? ??? ?? ? ? ??? ??? ???????.

Java? 4 ?? ?? ?? ????? ?? ??, ?? ??? ??, ?? ?? ? ?? ??? ?????. 1. ?? ?? (???, ??, int, long)? ????? ?? ?? ???? ? ?????. ??? ??? ???? ???? ??? ??? ? ? ????. 2. ??? ?? (float, double)? ??? ?? ?????. ??? ?????????. ??? ?? BigDecimal? ?????. 3. ?? ?? (char)? ?? ??? ?????? ?? ??? ????? ?? ?? ??????? ???? ??? ? ????. 4. ?? ??? ??? ?? ??? ?? ???? ??? ??? ????? ?? ???? ??????.

Photoshop? ??? ???? ???? ?? ?? ?? ???? ????? ?? ?????. ????? ??? ?????? ??? ??? ??? ?? ??? ??? ?? ? ????. Photoshop?? ??? ???? ???? ?? ?? ?? ?? ??? ? ?, ??? ???? ? ? ??? ??? ???? ???, ?, ?? ? ??? ?? ???? ???? ??? ?????. ? ??? ????? ??? ?? ??? ??? ??? ??? ?????. ??? ???? ????? ?? ? ???? ??? ??? ??? ???? ??? ???? ??????. ???? ?? ???? ?? ??? ?????. ????,? ???? ?? ? ?? ???? ???? ??? ??? ??? ???? ????? ??????.

U? C ??? ???? ???? ?? ?? ??? ?????. 1. U ???? 10U? ?? ???? ?? ??? ?????. 2. ???? ?? ??? ??? 0?? ???? ??? ???? ????. ??? ?? ? ?? ??? ?????. 3. ???? ?? ??? ??? ? ???? ? ?? ?? ?????????.

Java? ?? ????? ??? ?? ???? "? ?? ??, ?? ??? ??"? ??? ??? ?????. 1. Java? ??? C? ???? ??? ???? ?? ??? ??? ???? ??? ?????? ??????? ?????. 2. Python? ??? ? Java? ?? ? ??? ??? ??? ? ?? ??? ????. Java? ??? ??? ??? JVM (Java Virtual Machine)?? ?????. JVM (Java Virtual Machine)? ?? ????? ??? ??? ??? ???? ?? ? ??? ??? ? ? ??? ??? ? API? ???? ?? ???? ???? ?????????.

Nginx? ?? ?? ??? ?? ??? ???? ?? ? ??? ????? ???? ? ???? ??? ?? ?????. 1) ?? ?? ??? ????? /etc/nginx/nginx.conf???. ??? nginx-t ??? ???? ??? ??? ? ? ????. 2) ?? ???? ?? ?? (? : ???, Worker_Processes) ? HTTP ?? (? : log_format)? ?????. ??? ??? ?? ??? ?? ??? ?? ? ??? ?????. ??? ???? ?? ?? ??? ?? ???? ??? ? ????.
