Write a java code to print odd numbers from 1 to 10.
pls answer this fast
Answers
Answered by
1
I think you know the introduction of writing import java. io..... So I'm posting the main part
Attachments:
Similar questions
Physics,
7 months ago
CBSE BOARD X,
7 months ago
Math,
7 months ago
Social Sciences,
1 year ago
Social Sciences,
1 year ago
Social Sciences,
1 year ago
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 + " ");
}
}
}
}