We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fc6372e commit aa43c5cCopy full SHA for aa43c5c
terminal_bar_graph.java
@@ -0,0 +1,31 @@
1
+import java.util.*;
2
+public class terminal_bar_graph
3
+{
4
+ public static void main(String args[])
5
+ {
6
+ System.out.println("\u000C");
7
+ Scanner sc=new Scanner(System.in);
8
+ System.out.println("Enter 10 numbers: ");
9
+ int a[]=new int[10];char b=(char)(9608);char c=(char)(9612);
10
+ int d[]=new int[10];
11
+ int e[]=new int[10];
12
+ for(int i=0;i<10;i++)
13
14
+ a[i]=sc.nextInt();
15
+ e[i]=a[i];
16
+ d[i]=a[i]%2;
17
+ a[i]=a[i]/2;
18
+ }
19
20
21
22
+ for(int j=0;j<a[i];j++)
23
24
+ System.out.print(b);
25
+ if(d[i]==1&&j==a[i]-1)
26
+ System.out.print(c);
27
28
+ System.out.println(e[i]);
29
30
31
+}
0 commit comments