java program to multiply even numbers between 2 to 20
9th class
no spam otherwise it answer will be deleted
Answers
Answer:
I think this should be the answer for it
Explanation:
/ Java Program to Calculate Sum of Even Numbers using for loop
import java.util.Scanner;
public class SumofEven1 {
private static Scanner sc;
public static void main(String[] args)
{
int number, i, evenSum = 0;
sc = new Scanner(System.in);
System.out.print(" Please Enter any Number : ");
number = sc.nextInt();
for(i = 1; i <= number; i++)
{
if(i % 2 == 0)
{
evenSum = evenSum + i;
}
}
System.out.println("\n The Sum of Even Numbers upto " + number + " = " + evenSum);
}
}
public class Sum {
public static void
main(String[ ] args){
int sum=0;
for(int i=10; i<=100;
i=i+2){
sum = sum + i;
}
System.out.println(sum);
}
}
PLEASE MARK AS BRAINLIEST ❤️