-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharray_8.java
More file actions
28 lines (24 loc) · 529 Bytes
/
array_8.java
File metadata and controls
28 lines (24 loc) · 529 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
public class array_8{
public static void main(String args[]){
int a[] = {121,31,144,523,572,354,876,742,192,432,4567,873};
int b[] = new int[a.length];
for(int i=0; i<a.length; i++)
{
int temp=0, count=0;
temp = a[i];
int digit1=0, digit2=0;
while(temp != 0){
temp/=10;
count++;
}
digit1 = a[i];
for(int j=1; j<count; j++){
digit1/=10;
}
digit2 = a[i]%10;
b[i] = digit1 * 10 + digit2;
}
for(int i=0; i<b.length; i++)
System.out.print(b[i]+" ");
}
}