Home Answers Viewqa Java-Beginners loop, control statements

 
 


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

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 Pages:
loop, control statements
loop, control statements  a java program to print
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
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
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
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
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
Loop Control flow enhancement discussion - Java Tutorial
Loop Control flow enhancement discussion 2001-04-28 The Java Specialists... next issue reminding people that Exceptions are not meant to be used as Loop control / Loop Control flow enhancement. I could see someone putting your switch
Summary - Statements
Java: Summary - Statements Each control statements is one logical statement... these if expr != any above }  Loop Statements while... (testExpression) { statements } Other loop controls All loop
loop, control structures
loop, control structures  a java program to print
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 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
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
Summary - Control Flow
: statements // do these if expr != any above } while loop... (testExpression) { statements } Other loop controls All loop... loop This is the least used of the loop statements, but sometimes a loop
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
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
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;   
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
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 : 
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
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...; statements;    } In this program you will see how to use the while loop
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
'for' Loop
Java Notes'for' Loop Purpose The for statement is similar... The for and equivalent while statements have these forms. for (init-stmt; condition; next... before the loop is started, usually to initialize an iteration variable
PHP For Loop
For Control Structure: In for loop construct there are three parts of For loop... increment or decrement the variable(s). Format of for loop is as below: for(variable initialization; condition; variable increment/decrement) statements; We can
Loops - Introduction
of loop statements is to repeat Java statements many times. There are several kinds of loop statements in Java. while statement - Test... to control whether the body is executed. Scope of loop indicated
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
Using "Case" control in JRuby
Using "Case" control in JRuby ... you have learned to use for-loop in JRuby. Now we will discuss that how to use "Case" control in our program to provide working of program on selected
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
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
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
SQL Simple LOOP
repeatedly until it push the flow of control to outside of the loop.... The Loop run repeatedly until it push the flow of control to outside... SQL Simple LOOP      
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. The statement
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
Until Loop In a Procedure
Until Loop In a Procedure       Until Loop In a Procedure is used to execute a set of statements... Beginners trapped with the problem of  execution of loop
Java Review: Control Flow
Java Review: Control Flow Java uses the dominant imperative control flow.... Structured Programming control flow primitives within a method: Sequence... statements depending on a condition (if and switch statements). Repetition
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?   
Control Statments
the control statements in C++. You must be familiar with the if-then statements... Control Statments       We all know that the execution of the statements in a program takes place from
MySQL Transactional and Locking Statements
MySQL Transactional and Locking Statements       MySQL5.0 supports local transactions by statements... a group of SQL Statements, which executes as a unit. And MySQL either executes all
C break continue example
to force an immediate jump to the loop control statement. The break statement terminates the execution of the loop. As you can see in the given example, we have used both the statements within the do while loop. The program prompts the user
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
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
SQL Simple LOOP
repeatedly until it push the flow of control to outside of the loop.... The Loop run repeatedly until it push the flow of control to outside... SQL Simple LOOP      
Until Loop In a Procedure
Until Loop In a Procedure       Until Loop In a Procedure is used to execute a set of statements... Beginners trapped with the problem of  execution of loop
Loop break statement
kinds of tasks, so many loops tend to be one of several common styles. Loop reading input Immediate loop exit. When you execute a break statement, the loop is exited immediately and control flow proceeds with the the statement after
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
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 Statement in java 7
For Loop Statement in java 7 In this section, we will discuss about for loop in java 7. This is one type of  loop statement. For Loop Statements...) {....... ...... //Statements } Example : Here is simple for loop example. First we
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
Java break for loop
control outside the outermost loop.           Break... Java break for loop       Example below demonstrates the termination of for loop under label
Continue Statement
; The continue statement occurs only inside the iterator statements like while, do or for statements. The continue statement skips the current iteration (for while or a do-while loop). A Continue statement with no label skips to the end

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.