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 56f1568 commit 0da1876Copy full SHA for 0da1876
BreakDigit.java
@@ -0,0 +1,37 @@
1
+/*
2
+ * To change this license header, choose License Headers in Project Properties.
3
+ * To change this template file, choose Tools | Templates
4
+ * and open the template in the editor.
5
+ */
6
+package com.mycompany.worksheet1;
7
+
8
+import java.util.Scanner;
9
10
+/**
11
+ *
12
+ * @author Shanmuga Priya M
13
14
+public class breakdigit {
15
16
+ /**
17
+ * @param args the command line arguments
18
19
+ public static void main(String[] args) {
20
+ int n,r,i,j;
21
+ i=0;
22
+ int a[]=new int[10];
23
+ Scanner obj= new Scanner(System.in);
24
+ n=obj.nextInt();
25
+ while(n>0){
26
+ r=n%10;
27
+ a[i]=r;
28
+ n=n/10;
29
+ i++;
30
+ }
31
+ for(j=i-1;j>=0 ;j--){
32
+ System.out.println(a[j]);
33
34
35
36
37
+}
0 commit comments