Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners plese tell me the control flow of this program

Have Programming Question? Ask it here!
 
 
 


kalyanitokuri
plese tell me the control flow of this program
1 Answer(s)      2 years and 2 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
Pls anyboby tell me...
Pls anyboby tell me...  which book easy to learn spring
Tell me - Struts
Struts tutorial to learn from beginning   Tell me, how can i learn the struts from beginning
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
, 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
(); ^ 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
: '}' 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
)); ^ 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
(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
please tell me  why we use public static main(String ar){} in java instead of main
please tell me
please tell me  which cmd we use to clear the screen in sql prompt
please tell me
; ^ please tell me the resolution   class Reserve...please tell me  class Reserve extends Thread{ int available=1; int wanted; Reserve(int i){ wanted = i; } public static void
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
please tell me
please tell me  select * from emp order by 5 desc; in the above what is the meaning of 5, and what its functionality
please tell me
please tell me  what are the topics in core and advaced java....   Hi Friend, Please visit the following links: http://www.roseindia.net/ http://www.roseindia.net/java/ Thanks   Hi Friend, Please visit
please tell me
please tell me  class Person{ int age; String name; void talk(){ System.out.println("my name is:"+name); System.out.println("my age is:"+age); } } class Hash{ public static void main(String ar[]){ Person raju=new Person
please tell me
please tell me   <tr> <td><html:hidden property="tid" value="${user.id}"/></td> <td><bean:write name="user" property="emp_name"/>
please tell me
please tell me  Blockquote Blockquote> BlockquoteBlockquote how to get images from ms access databases to jsp pagesBlockquote   Jsp get image from ms access database Create a table named user(id,name,address,image
please tell me
please tell me  what is the source code if user give wrong user name password the explorer will show incorrect username password   <% String vlname=request.getParameter("lname"); String vpwd=request.getParameter
Flow Control Constructs
Flow Control Constructs       Flow Control Constructs include the IF, CASE, LOOP, WHILE, ITERATE... label The LEAVE Statement is used to exit from any flow control constructs
Software graduates please tell me,
Software graduates please tell me,  How to view image on Frame in swing(or)awt in Java
Software graduates please tell me,
Software graduates please tell me,  How to view image on Frame in swing(or)awt in Java
plzz tell me java code for that diamond
plzz tell me java code for that diamond   1 131 13531 1357531 13531 131 1
Can anybody tell me how to resolve this issue?
Can anybody tell me how to resolve this issue?  java.lang.Exception: Exception : java.lang.Exception: Generic Errors = java.util.MissingResourceException: Can't find bundle for base name Connection, locale en_US
Please tell me the code to generate the below structure
Please tell me the code to generate the below structure  1 2 3 4 5 6 7 8 9 1 2 3 4 6 7 8 9 1 2 3 7 8 9 1 2 8 9 1 9 1 2 8 9 1 2 3 7 8 9 1 2 3 4 6 7 8 9 1 2 3
Can you tell me how it worked?
Can you tell me how it worked?  public class Ball { private static final int DIAMETER = 30; int x = 0; int y = 0; int xa = 1; int ya = 1; private Game game; public Ball(Game game) { this.game= game; } void move
please tell the reason for java.lang.ArrayIndexOutOfBoundsException: in program
please tell the reason for java.lang.ArrayIndexOutOfBoundsException: in program  public class Test { public static void show(int x[][],int y[][]){ int rows = x.length; int columns = y.length
plese help
plese help  i need a program to convert a decimal num into binary num in java language by using array and loop   Java Convert decimal to binary import java.util.*; public class DecimalToBinary{ public static void
please tell me about command line arguments in java?
please tell me about command line arguments in java?  please tell me... arguments are the arguments which are sent to the program being called. You can take any number of command-line arguments which may be necessary for the program
Please tell me how can i convert string to timer
Please tell me how can i convert string to timer  Please tell me how can i convert string to timer
Advertisements
 

 

 

DMCA.com