Create a 10 element integer array and store some integer values display as the counting of 0.

public class JavaEx {
    public static void main(String args[]) {

        int numbers[] = {10,15,0,0,6,0,0,1,6,4};
        int x,count,len;

        count = 0;
        len = numbers.length;

        for(x= 0; x < len; x++)
        {
            if(numbers[x]==0)
            {
                System.out.println(numbers[x]);
                count++;
            }
        }
        System.out.println(count);
    }

}

above examples  int numbers[] = {10,15,0,0,6,0,0,1,6,4};  here there is 4 zeros.

Output display as

0
0
0
0
4

 

admin

Recent Posts

Chat with Claude AI Free – Your Super-Smart AI Buddy

It's like having a super-smart buddy that is always there to help you write stories,…

2 days ago

Best Festivals UK 2025 [Free Guide Included]

The UK is known for its rich history, diverse culture, and most of all  its…

5 days ago

Bank Holidays 2025 UK – Plan Your Perfect Long Weekends

Do you have a plan for your next holiday? Being aware of the Bank Holidays within the…

5 days ago

Master Cursor AI Full Guide for Students & Creators

The world is rapidly changing of software development AI-assisted tools for coding have become the main focus. As…

6 days ago

Google Gemini AI Free AI Tool for Students & Creators

Google Gemini AI is among the top talked about developments. What exactly is it? What…

6 days ago

Top 5 Reasons You Should Use Grubby AI Humanizer in 2025

As the need for AI content undetectable humanization software skyrockets with more and more AI…

2 weeks ago