Share on Google+Share on Google+

nisha
loop, control statements
2 Answer(s)      6 years 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.










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 What does core Java include? java What are some way to learn Java quickly? Is it required to learn Java before learning Java Script? Is it necessary to learn java script before learning PHP? Are HTML5 and Java Script boosts Java career? Is Java object oriented? Fingerprint application with Java Uninstall Oracle Virtual Box JSON to HashMap Free Java online Training I want example of Control Statement in Java ANSI Color Codes with Python Create a Program that Calculates Input What is difference between JDK,JRE and JVM? How to see ubuntu version on server? How to get Page Source in Selenium (WebDriver) using Java? The path to the driver executable must be set by the webdriver.gecko.driver system property parse data from a link in java Java Program Qns using BlueJ How to fix HAX Kernel Module Is Not Installed error? Installing Audacity Looking for code Logic to check track changes & Coments in MSWord, MSWordx, MSExcel, MSExcelx is ON/OFF Installing JDK on Mac SAX Parser exception ERROR 601 (42P00): Syntax error. Encountered Thread java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItemFactory How to install Ubuntu 16.04 LTS? HttpServletRequest cannot be resolved to a type in eclipse - Solved Unhandled event loop exception GC overhead limit exceeded Spring Data jpa with apache phoenix Caused by: java.lang.IllegalArgumentException: Not a host:port pair: PBUF o.a.h.h.z.RecoverableZooKeeper - Possibly transient ZooKeeper, quorum= com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager class not found com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager not found How to download and install Java 8 on Windows? How to uninstall JDK 7? How to install gtk-doc-tools package in Ubuntu? How to install Oracle JDK 8 on Ubuntu? ejabberd_ctl.beam not found - Solved How to convert date to UTC format in Java? How to install autoconf, automake and libtool in Ubuntu 15.10? How to convert current date to mm dd yyyy format in Java? How to convert current date to dd mm yyyy format in Java? How to stop window closing in "internalFrameClosing" event. How to find list of all index in Neo4j? neo4j-server.properties file location SASLError using PLAIN: not-authorized how to convert war file into .exe file using java code

Ads

 
Advertisement null

Ads