here is java code using arrays

in #java6 years ago

import java.util.Scanner;

public class bhatti {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int array[] = new int[10];
System.out.println("enter values you want to store in array: ");
for (int i = 0; i < array.length; i++) {
System.out.println("array[" + i + "]");
array[i] = input.nextInt();
if (array[i] > 9) {
System.out.println("ERROR, array should be less than or equal to 9");
return;
}
}
int i = 0;
int newarray;
int count;
while (i < array.length) {

        newarray = array[i];

        count = 0;

        for (; i < array.length && newarray == array[i]; i++, count++)
            ;

        System.out.println("array[" + count + "] " + newarray);

    }

}

}

Sort:  

You got a 4.50% upvote from @postpromoter courtesy of @mehram!

Want to promote your posts too? Check out the Steem Bot Tracker website for more info. If you would like to support the development of @postpromoter and the bot tracker please vote for @yabapmatt for witness!

32 USD for non indented piece of java code. Earned in just one hour. Wow. Just wow.

Coin Marketplace

STEEM 0.29
TRX 0.12
JST 0.033
BTC 70586.26
ETH 3763.77
USDT 1.00
SBD 3.79