Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Spring Framework | Web Services | BioInformatics | Java Server Faces | Jboss 3.0 tutorial | Hibernate 3.0 | XML

Tutorial Categories: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML


 

Java Tutorials


 

 

Struts Tutorials

Struts Resources

Visit Forum! Post Questions!
Jobs At RoseIndia.net!

Java Beginners ForLoop

User Comments
Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl
  Blink   Furl   Simpy   Y! MyWeb 

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 

Current Comments

58 comments so far (post your own) View All Comments Latest 10 Comments:

hello,,

Posted by imran on Thursday, 10.21.10 @ 13:19pm | #100403

can u help me to do a program that the output will be:
Enter size: 5
1 2 3 4 5
1 1
2 2 4
3 3 6 9
4 4 2 12 16
5 5 10 15 20 25

it is a modified multiplication table.. i dont know how to create it...help pls

Posted by altercode on Saturday, 10.16.10 @ 09:09am | #100312

can u help to make this program

1
23
456
78910
1112131415
161718192021

Posted by reymart on Wednesday, 09.29.10 @ 19:54pm | #99943

create a program that will output:

5
44
333
2222
11111
000000

Using while, do-while and forloop

Posted by Apryl Blythe M. Lobrigas on Saturday, 09.25.10 @ 08:19am | #99857

tnx....its a big help for me...

ur website is so nice!

Posted by gregg on Tuesday, 09.7.10 @ 07:39am | #99422

i need to have an output like this:

###
###
###

and this:

1 2 3 4 5
2 4 6 8 10
3 6 9 12 15
4 8 12 16 20
5 10 15 20 25


and also this:
number Square Cube
2 4 8
4 16 64
6 36 216
8 64 512
10 100 1000

total 220 1800


i'm very very thankful if you can help me..very appreciated!!

Posted by Khaye on Thursday, 09.2.10 @ 10:01am | #99316

how can we make a program with an output of a square using asterisk?

Posted by haven on Monday, 08.30.10 @ 16:10pm | #99272

it is nice for collecting the mail on net.

Posted by sandeep4mkp on Wednesday, 08.25.10 @ 16:36pm | #99154

Thank's for the idea!

Posted by richard castillo on Friday, 08.20.10 @ 11:17am | #99062

i need java programs in incrementing or loopings.

Posted by sandro morcozo on Tuesday, 08.10.10 @ 10:40am | #98802

Java en bueno y C++ :)

Posted by HANNY GA—GAN on Monday, 08.2.10 @ 13:08pm | #98626

can u please help me in writing the program to get the out put
1+2+3+4+5+6+7+8+9+10=45

Posted by mounisha on Sunday, 07.11.10 @ 11:45am | #98100

THIS WEB SITE VERY GOOD SITE I LIKE THIS WEB SITE ALL THE BEST THIS WEB SITE

Posted by SUJEEWAN on Thursday, 07.1.10 @ 10:00am | #97876

can you please tell me how to design a programme for this particular output.
output:-
n=3
1 1
222 2 2
33333 3 3 3
222 2 2
1 1
taking an input int n to assign the numbers we need.e

Posted by sri on Sunday, 04.25.10 @ 12:36pm | #96614

*
* *
* * * *
* * * * * * * *

can someone make print like this in java for loop?

Posted by chamara on Monday, 04.19.10 @ 20:37pm | #96491

how to make a codes using for loop that the output is
*
*
*
*
*
*
*

Posted by lOtEr on Saturday, 03.20.10 @ 13:18pm | #95718

Java is the world famous programming language.

Posted by Sanjeev Kumar Jaryal on Monday, 03.8.10 @ 09:22am | #95379

can u help me to solve a problem like this..!!!
the current number is the sum of the two(2) previous number..EXample,,

1
1
2
3
5
8
13

help me..

Posted by loter on Saturday, 03.6.10 @ 09:08am | #95343

i need java programs

Posted by hannah nirubha on Tuesday, 01.19.10 @ 15:29pm | #94149

This code is very importent for biggner I want to say thaks to rose india.

Posted by Rishikesh on Thursday, 01.7.10 @ 14:29pm | #93854

can you please help for making a java program
example is this situation

1
21
321
4321
54321
654321

Posted by kenny on Tuesday, 01.5.10 @ 12:34pm | #93786

GIVE ME PERMITION

Posted by vikash on Sunday, 11.29.09 @ 14:56pm | #92930

how can we print series like this
1
232
34543
4567654
567898765
and
1
121
12321
1234321

Posted by zohaib on Tuesday, 11.3.09 @ 21:13pm | #92298

can somebody please help me how to make a javascript program that will give the following results?

&
##
&&&
####
&&&&&

Posted by vanitha on Thursday, 10.22.09 @ 08:22am | #92022

can somebody please help me how to make a javascript program that will give the following results?

-1
-1 -2
-1 -2 -3
-1 -2 -3 -4
-1 -2 -3 -4 -5

Posted by vanitha on Thursday, 10.22.09 @ 08:21am | #92021

can somebody please help me how to make a javascript program that will give the following results?

*
**
***
****
*****

Posted by vanitha on Thursday, 10.22.09 @ 08:19am | #92020

hi. your codes is easy.

Posted by jelo on Wednesday, 09.23.09 @ 08:37am | #91131

Pls help me in searching different program about for loop in java..tnx...pls. give me 10 examples

Posted by leah maneja on Sunday, 09.13.09 @ 14:51pm | #90871

Pls help me in searching different program about for loop in java..tnx...pls. give me 10 examples

Posted by leah maneja on Sunday, 09.13.09 @ 14:40pm | #90869

I WANT MOR EXMPLE IN FOR LOOP IN MY MAIL

Posted by atif on Tuesday, 08.4.09 @ 00:33am | #89785

can you give me the syntax of this result!

******
*****
****
***
**
*

Posted by dean on Saturday, 07.25.09 @ 07:49am | #89588

Can You please help me do this program which states the condition:
Write A program that will accept two numbers.The first Number will be the base and the second number is the exponent.
Example:
Enter Base number(1-9): 2
Enter Exponent: (1-9): 3
The Result is: 8

Posted by roselyn on Wednesday, 07.22.09 @ 10:39am | #89523

cn u help me how to do ds...


1 2 3 4 5 6 7 8 9 10
2 4 6 8 10 12 14 16 18 20
3 6 9 12 15 18 21 24 27 30

Posted by alec on Wednesday, 07.15.09 @ 08:11am | #89324


/*example AnnE*/
Enter a 4 digit name: Anne
Enter a Number: 3

Anne
Anne Anne
Anne Anne Anne

try Again?: Y

Enter a 4 digit name: John
Enter a Number: 4

John John John John
John John John
John John
John


try Again?: N


/*how van i make this one*?

Posted by patrick on Sunday, 06.21.09 @ 08:39am | #88662

Can anyone help?
I need to write some code whereby I have say for example the following values (amounts and ccy's):

USD 150
GBP 200
EUR 175
USD 400
JPY 350
GBP 100
EUR 550

I need to sum these amounts by the currencys so I return the following:

Totals
USD 550
GBP 300
EUR 725
JPY 350

Thanks in advance

Posted by Shane on Tuesday, 05.26.09 @ 22:47pm | #88050

public static void main(String[] args)
{
String inputBase = JOptionPane.showInputDialog("enter base number between 1-9");
String inputExponent = JOptionPane.showInputDialog("enter exponent between 1-9");
int base = Integer.parseInt(inputBase);
int exp = Integer.parseInt(inputExponent);

Math.pow(base, exp);
}
elastoshoes@yahoo.com

Posted by Elastos on Thursday, 04.30.09 @ 16:45pm | #87293

can you help me more in what and how to programme...

Posted by lucy on Tuesday, 04.21.09 @ 14:37pm | #86995

hi this is soni program is good but it is better to explain internal process

Posted by sonirao on Monday, 04.13.09 @ 16:21pm | #86770

im very sorry for toomuch delay but may use for future. here is answer for this

class test
{
public static void main(String[] args)
{
for (int i=1;i<=6 ;i++ )
{
if (i==4)
{
System.out.println();
System.out.print(i+" ");
}
else
{
System.out.print(i+" ");
}
}
}
}

Posted by kishore on Wednesday, 04.1.09 @ 13:20pm | #86408

i am so happy to find comprehensive step by step codes for beginners and for Free.I am so glad.Thank you so much for educating thousands of people .may god give your team lots of success.

Posted by amal on Tuesday, 02.3.09 @ 11:57am | #84454

give me the example of program using while
in multiplication table!!


thanks in advance!!

Posted by Lea on Monday, 02.2.09 @ 01:52am | #84394

define initial code for java programing language .

Posted by anadi krishna on Tuesday, 01.27.09 @ 02:55am | #84200

can you give some basic example program in java for my parctice

Posted by kans on Tuesday, 01.13.09 @ 00:38am | #83763

Public static void main(String[]args){
System.out.print("***
");
System.out.printLn("***
");
System.out.printLn("***
");

System.out.printLn("*****
");
System.out.printLn("*****
");
System.out.printLn("*****
");
}

Posted by liezel angel mae garcia on Wednesday, 01.7.09 @ 21:14pm | #83587

Can You please help me do this program which states the condition:
Write A program that will accept two numbers.The first Number will be the base and the second number is the exponent.
Example:
Enter Base number(1-9): 2
Enter Exponent: (1-9): 3
The Result is: 8

Posted by Saldy on Wednesday, 12.10.08 @ 22:21pm | #82616

I want more example on how to use looping in java program.

Posted by Ariel on Tuesday, 12.9.08 @ 01:54am | #82540

can you help me out in doing a java program using loops or to make a code that will allow the user to input as many integer as he/she wishes and then the program display the highest and the average among the number...

the out put like this

Enter a number:
5
10
5
5
8
4

The highest value is: 10
The average is: 5

Posted by ann on Tuesday, 11.18.08 @ 01:04am | #81765

can you help me out in doing a java program using loops that will allow the user to input as many integer as he/she wishes and then the program display the highest and he average among thr number...

the out put like this

Enter a number:
5
10
5
5
8
4

The highest value is: 10
The average is: 5

Posted by ann on Tuesday, 11.18.08 @ 01:01am | #81763

hello again,

can you help me out in doing a java program using loops that will display 10 names in a column then display on the opposite of each name the number of characters.
then at the bottom will display the same entries of names but this time in two columns, 1st name on the 1st column and the 10th being the 1st on the 2nd column.

ex:
Name: No of Char
Norman 6
Dandi 5
Olga 4
Danilo 6
Orlando 7
Manny 5
Rosalinda 9
Armand 6
George 6
Obama 5

Norman Obama
Dandi George
Olga Armand
Danilo Rosalinda
Orlando Manny

Thank you in advance.

Norman

Posted by Norman on Saturday, 11.15.08 @ 01:57am | #81692

Hiya, could someone please help with for loops in java. I'm looking to count the number of each sperate vowel in a string.

for (int i = 0;i < myString.length(); i++)

I know that the myString.length is wrong as java counts the number of vowels in each character rather than the full string.

How can I change this??

Thanks in advance
Doire1993

Posted by doire93 on Tuesday, 10.28.08 @ 22:02pm | #81375

please could some one help me with a small program i am working on at the moment involving a for loop i want to create all odd numbers from 1 to 20 and output to screen can u help
many thanks
david

Posted by david on Friday, 10.17.08 @ 01:02am | #81129

Hey Deepak,

Thank you very much for responding to my request. You have been very helpful.

hope to keep in touch with you again.

Thanks again.

Norman

Posted by Norman on Friday, 09.26.08 @ 08:44am | #80711

_____1
____232
___34543
__4567654
_567898765

Posted by Lester on Saturday, 09.20.08 @ 17:24pm | #80570

can somebody please help me how to make a java program that will give the following results?

***
***
***

*****
*****
*****

i will really, really appreciate it...

thanks a lot in advance...

Norman

Posted by Norman on Monday, 09.8.08 @ 13:29pm | #77967

Can anyone help me with creating a Java output like this please:

1 2 3
4 5 6

Posted by harvey13 on Wednesday, 08.13.08 @ 22:35pm | #72697

i want to know how to exit from for loop if a condition is true.

reply

Posted by sandeep on Wednesday, 06.11.08 @ 10:18am | #62997

send me java loop examples

Posted by Maximus on Sunday, 02.10.08 @ 19:38pm | #47788

How can I code in Java?
Output of the program :

1
232
34545
4567654
567898765

Posted by Vaishali on Tuesday, 12.11.07 @ 14:39pm | #41823

Ask programming questions?

 

 

Back to Tutorial

 

  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification

Tell A Friend
Your Friend Name

 

 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2007. All rights reserved.