Even number Analysis:
If(8%2 = 0 ) // check if I is even
If (I % 2 == 1) // check if I is odd number
1. even numbers are numbers that are divisible by 1 and the number itself.
Display the sum of an integer
enter by the user
while(true){
// condition is always true.
// so we need a break statement
// to comes out of the loop.
}
1.sum of the Strict divisor of an Integer: Example: 6 = 1+2+3=6
2. what do we means by strict divisor of a number?
The strict divisor of a number is n / 2.
the strict divisor of a number is an integer that evenly divides another number without leaving a remainder, except for the number itself. in order words, it is a divisor that is smaller than the number itself.
the strict divisor of 12 are : 2,3,4, and 6. 1 is a divisor of 12, but it is not a strict divisor because 1 is equal to the number itself(12).
1. i <= n/2 means
2.sum += i means that we are adding the value of i to sum.
3. if( number%i == 0) means we check if the number enter is divisible by the current number i . if the remainder is zero, it means i is a divisor of number.
2.using boolean logic.
boolean isprime = true;
isprime = false;
3. i<=n/2
1 i < n -2
1.name.CharAt(i) this print the character at the current index i.
of any element or data store in the name variable. example: Darius: the first index is 0, so the first character is D this will print the character the character D in the string.
charAt(); this is a method in java that is used to get the character at a specific index of a string data.
1.Reverse a string
2. how do you reverse a string