kalyanitokuri
plese tell me the control flow of this program
1 Answer(s)      2 years and 11 months ago
Posted in : Java Beginners

public class starForTest

{

    public static void main(String [] args)

    {

            for (int i=1; i<=9; i++)

            {

                    System.out.println();

                    for (int j=9; j>=i; j--)

                    {

                            System.out.print(" ");

                    }

             for (int k=1; k<=i; k++)

             {

                    System.out.print("*");

             }      

                            }

    System.out.println();   

    }

}

in this i is row num and j is column num... and what about k....? plese tell me the control flow

Advertisement
View Answers

June 15, 2012 at 11:16 AM


In your code, the i in for loop (int i=1; i<=9; i++) generates the nine rows to display the aestricks. Then, the j in for loop (int j=9; j>=i; j--) decreases the spaces by 1 throughout the rows. After that k in the last loop generates the aestricks in nine rows.










Related Tutorials/Questions & Answers:
plese tell me the control flow of this program
plese tell me the control flow of this program  public class starForTest { public static void main(String [] args) { for (int... k....? plese tell me the control flow
plese expalin the flow of this program
plese expalin the flow of this program  class Bticket extends Thread { Object train,comp; Bticket(Object train,Object comp){ this.train=train; this.comp=comp; } public void run(){ synchronized(train
Advertisements
please tell me the flow of execution of this program
please tell me the flow of execution of this program  class Test{ int x; Test(int x){ this.x=x; } static void access(){ System.out.println("x= "+x); }} class Static{ public static void main(String ar[]){ Test obj=new Test(55
Please explain me the flow of this program..
Please explain me the flow of this program..  // Substring replacement. class StringReplace { public static void main(String args[]) { String org = "This is a test. This is, too."; String search
please explain me the flow of this program
please explain me the flow of this program  class Bticket extends Thread { Object train,comp; Bticket(Object train,Object comp){ this.train=train; this.comp=comp; } public void run(){ synchronized
i got illegal start of expression error , plese tell me the mistake where i did...
i got illegal start of expression error , plese tell me the mistake where i did...   import org.springframework.context.*; import java.util.*; public class MyListener implements ApplicationListener { public static void main
plese tell -Struts or Spring - Spring
plese tell -Struts or Spring  Hello, i want to study a framework. i have some basic overview of Struts1.1 and Strurts 2.0. i don't know much about spring. which frameork i should do Struts or Spring and which version. i
please eslain me the flow of execution of this program
please eslain me the flow of execution of this program  class Producer extends Thread { StringBuffer sb; boolean dataprodover = false; Producer(){ sb = new StringBuffer(); } public void run(){ for(int i=1;i<=10;i++){ try
Struts control data flow
Struts control data flow  How Struts control data flow
Flow control of hibernate application..
Flow control of hibernate application..  Hello Roseindia team, Please provide flow control of hibernate application.. i.e when it goes to mapping file? when it goes to DAO's? when it goes to hibernate config files?? etc
expression and flow control
expression and flow control  write the program calculate and print the bill of communication telephone mobile company the company offer 2 types of services is regular (r) and premium (p) the rates are computed as follow
what error in this program plese correct it
what error in this program plese correct it  import java.io.*; class y { public static void main (String args[]) { Data inputStream dis = new Data inputstream(System.in); float l,b,a; Systyem.out.println("enter the lengh"); l
Tell me - Struts
Directory Structure with example program Execution  Tell me the Directory Structure with example program Execution
Control Flow Statements in java 7
but you can also control flow of your program with the help of control flow.... So control flow statements break the flow of program and flow under some... program. We can divide control flow statements in the following sections
Tell me - Struts
Directory Structure for Struts  Tell me the Directory Structure for Struts
Tell me - Struts
Struts tutorial to learn from beginning   Tell me, how can i learn the struts from beginning
Pls anyboby tell me...
Pls anyboby tell me...  which book easy to learn spring
please tell me
please tell me  i have created one table,when i close and again login, table name will be there, but its content not displayed, showing as no rows selected, please tell me the reason
Tell me - Java Beginners
Tell me   how to create a valid.js file please tell me and give the write code Thanks  Hi friend, Please give details for requirement of this "valid.js" file. For read more information http
please tell me
please tell me  Actually i am working on a Project tiitle is JavaMail System, 1)How to configure java mail API and a Demo Program for Sending mail and Receiving using JSP and Servlet
tell me coding for this
tell me coding for this  Write an application that displays the integer equivalents of the following character...A   Java get Integer value of Character class GetIntValueOfCharacter { public static void main
please tell me
(); ^ 1 error tell me the resolution please....   import...please tell me  import java.lang.Thread; class Current{ public static void main(String ar[]){ Thread t = Thread.CurrentThread(); System.out.println
please tell me
, but its compiled and run successfully, please tell me the reason...please tell me  class Person{ int age; String name; void Person1(String g,int a){ name=g; age=a; } Person(String s,int i){ name=s; age=i; } void
please tell me
: '}' expected ^ 2 errors, i got this error....... please tell me the resolution...please tell me  class Person{ string name; int age; void talk(){ System.out.println("my name is"+name); System.out.println
please tell me
please tell me  why we are using http protocol in servlets
plz tell me
plz tell me  how to get no. of times the 'button' is pressed   Here is a java swing code that counts the number of times the button clicked... CountButtonClicks(); } JButton button1 = new JButton("Click Me!"); int clickCount
please tell me
(10.6,20.0); ^ 1 error, please tell me the resolution for this...   ...please tell me  class Sample{ private double num1,num2; void sample(double x,double y){ num1=x; num2=y; } void Sum(){ double result=num1+num2
please tell me
)); ^ 1 error please tell me the resolution of this   Hi...please tell me  import java.io.*; class SString{ public static void main(String ar[]) throws IOException{ BufferedReader br = new Bufferedreader
please tell me
please tell me  which cmd we use to clear the screen in sql prompt
please tell me
please tell me  why we use public static main(String ar){} in java instead of main
please tell me
got error as Inner class connot have static declarations pls tell me...please tell me  class Producer extends Thread { StringBuffer sb; boolean dataprodover = false; Producer(){ sb = new StringBuffer(); } public void