Computer Science, asked by sgarg12092000, 1 year ago

write a java program to print all even numbers and odd numbers and their sum from one to hundred​

Answers

Answered by Anonymous
1

Explanation:

Java program to display odd numbers between 1 -100

class OddNumber {

public static void main(String args[]) {

System.out.println("The Odd Numbers are:");

for (int i = 1; i <= 100; i++) {

if (i % 2 != 0) {

System.out.print(i + " ");

Similar questions
Math, 7 months ago