loop, control statements

loop, control statements

a java program to print

                              *
                            * *
                          * * *
                        * * * *
                      * * * * *
                    * * * * * *
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
Java Control Statements     ... the control statements. Different types of control statements: the decision making... and for) and branching statements (break, continue and return). Control
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... increment or decrement as you specify. 2. Do-while Loop : It is a control... that the statements in the loop will get execute once before the expression
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 Statements : Branching statements are categorize in the following types : ADS
Java Control Statement
while loop. do-while loop. 1. The for loop : A for loop is a control structure... to the next iteration of the loop. In other word this statements is used to skip...Java Control Statement Control flow statement is a statement that is used
do while loop
do while loop       In java a do while loop is a control flow statement that allows a certain code to be executed repeatedly based on a given condition. This loop is used in java
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
loop
loop  what is the difference b/w do while,while and for loop..with example
loop
loop  i want to write my name(inder) through loop in java using star
For loop
For loop  Hi! Please explain the following loop: for(i=0;i<a[j];i++) THANX!!   Please reply as soon as possible
SQL Simple LOOP
that are executed repeatedly until it push the flow of control to outside of the loop... the flow of control to outside of the loop.  Create Procedure... SQL Simple LOOP      
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
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
Decision-making Statements in java 7
Decision-making Statements in java 7 In this section, we will discuss about 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
Loop in java
Loop is the control statement of any language in which whenever you want to perform the repetitious work then you use the Loop control statement. There are mainly three types of loops. Loop repeats a statement or a process multiple times
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
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
How to use 'for' loop in jsp page?
'for' loop is used to define a loop that reiterates statements. It specifies initialization variables, exit condition and the statements to be executed for the loop... How to use 'for' loop in jsp page?   
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
predicates and statements?
predicates and statements?  Explain about predicates and statements
While Loop in JSP
While Loop in JSP          The while loop is a control flow statement.... In while loop the condition is firstly evaluated, if it finds that the condition
Flow Control Constructs
Flow Control Constructs       Flow Control Constructs include the IF, CASE, LOOP, WHILE, ITERATE... and WHILE Statements. ITERATE is used to iterate (Continue) the loop again
While Loop
the repetitious work then you use the Loop control statement. ... the statements or processes written under the while loop are executed otherwise ignored... While Loop       Loop
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
Java Break out of for loop
in stopping the program  control flowing inside the loop and bringing... Java Break out of for loop       In loop programming the program flow is continued till
Iteration without loop
Iteration without loop  Hi, Is there any way I can have a line of code iterate a number of times set by the user without having a while loop or any other control statements? Thanks!   import java.util.*; class
PHP Control Structure
Control Structures: Generally a PHP script is made of a series of statements which includes assignment, collection of functions, loop, conditional statements etc. In PHP except the last line we need to put a semicolon after every line
While Loop Statement in java 7
While Loop Statement in java 7 This tutorial, helps you to understand the concept of while loop  in java 7. While Loop Statements : While loop.... You can use any counter to iterate the loop. This type of control structure
For..in loop
For..in loop         In this tutorial we will study for..in loop which is similar to for each loop of C#, Java and other popular languages, in this example
Java for loop
Java for loop  Can a for statement loop indefinitely
JSP for loop Example
JSP for loop Example In this section we will discuss about for loop in JSP. In every programming languages for loop is used. The for loop statement provide... will illustrate how to use for loop in JSP. Example : In this example we are going
FOR Loop In JSP
are differentiated by their syntax. Loop is the execution of statements in a repeated manner. Loop statements are executed on the specified condition... to be as an iteration of statements. Generally, for loop is used for the known
DECESION MAKING STATEMENTS
DECESION MAKING STATEMENTS  The Decision Making statements may be implemented in different forms depending on the complexity of the condition to be tested. Describe various forms of decision making statements in java
SQL Simple LOOP
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 in Java
For Loop in Java - Java For Loop Examples & Syntax       The for loop is the type of  looping construct. It also works as while loop construct but it provide the initialization
For Loop - Struts
For Loop  Hi, How to use for loop in Struts2. I don't want use.... How to use the For loop in JSP. Thanks, Rajesh.  Hi Rajesh, i am sending simple use of for loop. In this example, you will see the use
for( ) loop in php
for( ) loop in php  Generally, when we use for loop in PHP or any other programming language why we use i++ and not ++i. What is the reason behind
for( ) loop in php
for( ) loop in php  Generally, when we use for loop in PHP or any other programming language why we use i++ and not ++i. What is the reason behind
Limits of "For loop"
Limits of "For loop"  Hi, How can I check the upper limit and lower limit of 'FOR' loop during unit testing using Junit. Thanks & Regards Ankit

Ads