to print the sum of first 10 even numbers
Answers
Answered by
0
Answer:
import java.util.*;
public class Even_series
{
public static void main (String[]args) {
Scanner sc = new Scanner (System.in);
System.out.println("Enter the limit to where the even numbers should be printed :");
int num = sc.nextInt();
for (int i = 1; i < num; i++) {
i = i + 1;
System.out.print(i + " ");
}
}
}
Similar questions
Math,
7 months ago
Business Studies,
7 months ago
Science,
1 year ago
History,
1 year ago
English,
1 year ago
Social Sciences,
1 year ago