public class JavaApplication5
{
    public void CozaLozaWoza(int c, int l)
    {
        boolean tf;
        for (int i = 1; i <= c; i++)
        {
            tf = false;
            if (i % 3 == 0)
            {
                System.out.print("Coza");
                tf = true;
            }
            if (i % 5 == 0)
            {
                System.out.print("Loza");
                tf = true;
            }
            if (i % 7 == 0)
            {
                System.out.print("Woza");
                tf = true;
            }
            if (!tf)
            {
                System.out.print(i);
            }
            System.out.print(" ");

            if (i % 11 == 0)
            {
                System.out.println();
            }
        }
        System.out.println();
    }

    public static void main(String[] args)
    {
        JavaApplication5 a = new JavaApplication5();
        a.CozaLozaWoza(110, 11);
    }
}

asked 02 Oct, 14:26

minhaz111's gravatar image

minhaz111
212

edited 07 Oct, 16:19

Mosharraf%20Hosain's gravatar image

Mosharraf Hosain ♦
315


boolean tf;
tf = false;
if (!tf)
        {
            System.out.print(i);
        }

আপনার প্রোগ্রামে উপরের কোডটুকু গুলো লক্ষ্য করুন। ১ থেকে ১১০ এর মধ্যে যে সব সংখ্যা ৩,৫,৭ দ্বারা বিভাজ্য নয় তাদের ক্ষেত্রে

tf == false

থাকছে, ফলে সেসব মান প্রিন্ট হবে ।

if এর ভেতরের শর্ত, if(!tf) থাকার মানে হলো tf == false

permanent link

answered 07 Oct, 18:47

Sheikh_Fahad's gravatar image

Sheikh_Fahad
1956

edited 08 Oct, 01:24

Mosharraf%20Hosain's gravatar image

Mosharraf Hosain ♦
315

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×1

question asked: 02 Oct, 14:26

question was seen: 70 times

last updated: 08 Oct, 01:24

Related questions