Write a java program using loop to check whether a number is perfect square or not.
Answers
Answered by
0
Answer:
Java Program to Check if a given Number is Perfect Number
- public class Perfect.
- int n, sum = 0;
- Scanner s = new Scanner(System.
- System. out. print("Enter any integer you want to check:");
- n = s. nextInt();
- for(int i = 1; i < n; i++)
- if(n % i == 0)
- sum = sum + i;
Answered by
12
Answer :-
Java Program to Check if a given Number is Perfect Number
- public class Perfect.
- int n, sum = 0;
- Scanner s = new Scanner(System.
- System. out. print("Enter any integer you want to check:");
- n = s. nextInt();
- for(int i = 1; i < n; i++)
- if(n % i == 0)
- sum = sum + i;
Similar questions