We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5c5ed0f commit 7e5037bCopy full SHA for 7e5037b
Test8_odd_number_inRange.java
@@ -0,0 +1,54 @@
1
+//Print Odd Numbers in Given Range
2
+
3
+package com.test.Basic_Java_Programs;
4
5
+import java.util.Scanner;
6
7
+public class Test8_odd_number_inRange
8
+{
9
+ public static void main(String[] args)
10
+ {
11
+ int n;
12
13
+ System.out.print("Enter Range :");
14
15
+ Scanner sc = new Scanner(System.in);
16
17
+ n = sc.nextInt();
18
19
+ for (int i = 1; i <= n; i=i+2)
20
21
+ System.out.println(i);
22
23
+ }
24
25
26
+}
27
28
29
+//Output :
30
+/*
31
32
33
+Enter Range : 30
34
+1
35
+3
36
+5
37
+7
38
+9
39
+11
40
+13
41
+15
42
+17
43
+19
44
+21
45
+23
46
+25
47
+27
48
+29
49
50
51
52
53
54
+*/
0 commit comments