Question: loop, control statements

Ads

 
 
 

Share on Google+Share on Google+

nisha
loop, control statements
2 Answer(s)      6 years and a month ago
Posted in : Java Beginners

a java program to print

                              *
                            * *
                          * * *
                        * * * *
                      * * * * *
                    * * * * * *
Ads
View Answers

March 31, 2011 at 3:26 PM


class Pyramid{
    public static void main(String[] args){
        int p = 6;
        for (int i = 0; i <= 6; i++) {
        for (int j = p; j>= 1; j-- )
        System.out.print(" ");
        p-=1;
        for (int k = 1; k <= i; k++)
        System.out.print ("*");
        System.out.println();
        }
            }
        }


February 10, 2013 at 8:26 PM


* * *


please print the output of this program.


Ads









Related Tutorials/Questions & Answers:
loop, control statements
loop, control statements  a java program to print
loop statements
loop statements  write a program that reads from input an interger n and prints the factorial of all numbers between 1 and n
Advertisements
Java Control Statements
Java Control Statements       Introduction to Control Statements In this section, we are going to discuss the control statements. Different types of control statements
loop, control structures
loop, control structures  a java program to print
Java Control Statements
statements. When i is greater than value 10 control comes out of loop and next... Java Control Statements     ... the control statements. Different types of control statements: the decision making
Control Flow Statements in java 7
Control Flow Statements in java 7 In this section we will discuss Control Flow Statements in java 7. This is one type of Language Fundamentals. Control.... So control flow statements break the flow of program and flow under some
java program using control statements...
java program using control statements...  public class ControlStatements { public static void main(String args[]){ int x=10; if(x==0){ System.out.println("It is zero"); else if(x>0) System.out.println
Use while loop in jsp code
Use while loop in jsp code       While loop is a control flow statement that works repeatedly based on a given boolean condition, loop will continuously execute
Looping Statements in java 7
Statements in java 7. This is one type of control flow statement. Looping...-while Loop : It is a control structure which is similar to while loop except... of the loop, so that the statements in the loop will get execute once before
Java Control Statement
the control to the next iteration of the loop. In other word this statements... : A for loop is a control structure that allow to execute code specific number... loop : A while loop is a control structure that allow you to execute a task
for loop
;condition;increment) { //statements } The "for" loop works as follows- when the program control enters the loop it first does the initialization part... the statements given inside the loop and then goes to increment part and increments
Branching Statements in java 7
Branching Statements in java 7 In this section, we will discuss about Branching Statements in java 7. This is one type of control flow statement. Branching.... Syntax : loop (...){ condition{ continue; } ......//statements } Return
do while loop
do while loop       In java a do while loop is a control flow statement that allows a certain code...-while loop:     do   {   statements;   
for loop in java example
.style1 { color: #0000FF; } for loop in java example We are going to discuss about for loop in java example. The for loop statement has type loop control statement. We first initialize the variable. After that check
Loop
to understand a loop my quesiton are: what du i do wrong in my code since its endless. i would like to control the "start" stop" and step from an object. (made in blueJ) Class Loop public void loopUpGeneral(int start, int stop
Mysql Loop in Procedure
Mysql Loop in Procedure       Loop in Procedure is a simple loop construct that enables an repeated execution of the statement list, which consists of one or more statements. Each
Decision-making Statements in java 7
Decision-making Statements in java 7. This is one type of control flow statement. Decision-making Statements : This kind of control statements is used where.... If Statement : If statement is one of the basic control flow statements
loop
loop  i want to write my name(inder) through loop in java using star
loop
loop  what is the difference b/w do while,while and for loop..with example
SQL Simple LOOP
that are executed repeatedly until it push the flow of control to outside of the loop... type to int. The Loop run repeatedly until it push the flow of control... SQL Simple LOOP      
For loop
For loop  Hi! Please explain the following loop: for(i=0;i<a[j];i++) THANX!!   Please reply as soon as possible
for loop
for loop  how to performs the for loop when 2 inputs given like displays the triangle shape and how to take initial values or declaration values plz explain in detailed ex. 1 12 123 1234
For Loop
For Loop  Write a program using a for loop that computes the following sum: 1/2 + 2/2 + 3/2 + 4/2 + 5/2 + ... N/2 N will be an integer limit the user enters. This is an example of my upcoming quiz. I need help on knowing
for loop
for loop  using only two for loop how can print below numbers 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 8 8 8 8 8 8 8 8 7 7 7 7 7 7 7 6 6 6 6 6 6 5 5 5 5
for loop
for loop  using only two for loop how can print below numbers 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 8 8 8 8 8 8 8 8 7 7 7 7 7 7 7 6 6 6 6 6 6 5 5 5 5
loop
loop  strong textHello can someone help me with this problem,I need to output the following code using a loop the code is as follows with the user inputs in inverted commas,thanks. ENTER CODE(XX to Stop) CODE:"D24" QUANTITY:"2
Until Loop In a Procedure
Until Loop In a Procedure       Until Loop In a Procedure is used to execute a set of statements repeatedly until a certain condition is reached. Understand with Example
Flow Control Constructs
; Flow Control Constructs include the IF, CASE, LOOP, WHILE, ITERATE... statements. These statements can repeat the execution until the loop is exited... Statements. ITERATE is used to iterate (Continue) the loop again. Example : 
predicates and statements?
predicates and statements?  Explain about predicates and statements
Mysql Loop in Procedure
Mysql Loop in Procedure       Loop in Procedure is a simple loop construct that enables... statements.Each loop is terminated by a semicolon(;) or statement delimiter
PHP Control Statement
PHP Control Statement The PHP Conditional statements helps us to perform different actions for different decisions. You can use conditional statements.... In the current tutorial - we'll study two control statements: If..else
Tutorials   
Java Spring Hibernate Struts Training Apache Commons ioutils maven dependency Read/Convert an inputStream to a String What is the meaning of Java Platform? Why Java is a platform independent language? What is the benefits of learning Core Java? Which technology should I learn after Java? What is array in java with example? How to Convert ArrayList to Array? How to substring in Java? How to format number in Java? What is instance variable in Java? How to download MySQL JDBC driver? What is Calendar class in Java? Which is the best Java tutorials for beginners? How to rename a file in Java? How to delete file in Java code? How to get day from date in Java using Calendar? How to get day of week in Java? How to calculate Date Difference in Java? How to compare date in Java? How to declare array in Java? How to calculate average of array in Java? What is Array in Java? write a java program to find the summation of all the integers entered on command line Sum of two numbers using command line arguments in Java How to create and use Array in Java? How to pass command line arguments in Java? How to create Applet Hello World? Appending String efficiently in Java How to append String in Java? How to list even numbers between 1 and 100? How to add BigDecimal in Java? What is Abstraction In Java? Which is best Beginners Java Tutorial? What is java.util package? Create list from array in Java Filter collection in Java 8 What is the best way to filter a Java Collection? Easy way to transform Collection to Array? How to convert Collection to Array in Java? What are Basic Java Language Elements? Advanced Java Tutorials in 2017 Java brief history Best Reasons to learn Java Java Example Codes and Tutorials in 2017 How do I read a large file quickly in Java? Is learning Java worthwhile? How to create first Java Program? Retrieve database from the table dynamically in jsp from oracle using servlet What does core Java include?

Ads

 
Advertisement null

Ads