Core Java| JSP| Servlets| XML| EJB| JEE5| Web Services| J2ME| Glossary| Questions?

 

 

 

 

 

 

 

 

 

 

 

 

 

Search Tutorials:
 

Software Solutions and Services
 

 
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification
  Java Applet
Questions
Comments
 
Preparing table of a number by using loop 
 

In this section, you will learn how to preparing the table of a given number by using loop condition.

 

Preparing table of a number by using loop

                         

This tutorial will teach you the methods of preparing the table of a given number by using loop condition. As we know the loop statements are used to repeat a statement or process multiple times according to a specified condition. Loop checks certain condition and if it finds the condition is valuable then all the statements written under loop are executed. 

Here we will take a number a=25 of which we have to prepare a table. Define the integer a=25 and b=1 as the initial point. Now apply "while" condition of loop and confine b<=10 as we have to make a table of 25. Again define another integer as c=a*b, this will be the result when we multiply 'a' with 'b'. Here we have to multiply 'a' with 'b' up to 10 times like a*1, a*2....................a*9, a*10. So make define b=b+1 as increment operator. 

Now compile and run the program on the command window. 

Here is the code of the prorgram:

class  PreparingTable{
  public static void main(String[] args) {
    int a=25, b=1;
    System.out.println("the table of "+a+"= ");
    while(b<=10){
      int c = a*b;
      System.out.println(c);
      b = b+1;
    }
  }
}

Download this example.

                         

» View all related tutorials
Related Tags: c file array class list ui lists method get name using this oo root example where to exam drive store

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

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

Current Comments

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

Hi!
I m a B.Tech student from BBSR.I have to submit project based on core java and as I m a beginner in java I cant get perfect project for me.I m looking for a good project based on applet,swings or threads.I want some fresh and new topic for my project so i would like to know some of the topics from you Considering me as a java beginner.As i am fresher and i don't have much knowledge about the language please suggest me some solution for this problem.with some examplary as soon as possible.

Posted by Madhu on Saturday, 07.11.09 @ 09:36am | #89234

sir,i have 2 subbmit a project based on core java,please provide me with a gud core java project as soon as possible.with some explanation

Posted by rahul on Friday, 07.10.09 @ 23:02pm | #89231

Sir I m a sofware engineering student from new delhi.I have to submit project based on java and as I m a beginner in java I cant get perfect project for me.I m looking for a good project based on core java based on applet.I want some fresh and new topic for my project so i would like to know some of the topics from you Considering me as a java beginner my email id is sharma2856@rediffmail.com sir as i am the student of computer and engineering and as the part of curriculm i have to submit the minor project,i have decided to make the project in core java .as i am fresher and i don't have much knowledge about the language please suggest me some solution for this problem.with some examplary as soon as possible

Posted by suraj on Saturday, 11.29.08 @ 21:23pm | #82185

Sir I m a sofware engineering student from new delhi.I have to submit project based on java and as I m a beginner in java I cant get perfect project for me.I m looking for a good project based on core java based on applet.I want some fresh and new topic for my project so i would like to know some of the topics from you Considering me as a java beginner my email id is sharma2856@rediffmail.com sir as i am the student of computer and engineering and as the part of curriculm i have to submit the minor project,i have decided to make the project in core java .as i am fresher and i don't have much knowledge about the language please suggest me some solution for this problem.with some examplary as soon as possible

Posted by suraj on Saturday, 11.29.08 @ 21:20pm | #82184

please show more examples with their output.

Posted by Anagha on Sunday, 10.5.08 @ 15:06pm | #80910

hi... i need a java project for showing in my class, but i hav very less time. if anyone can send me some projects ,thanks

Posted by jaswinder singh on Friday, 08.8.08 @ 12:06pm | #71741

I am very happy searching this site. I have problem in servlet for calculating the 10 products with different quantity and different price. Can any body help me how to write a code in servlet. Because in html page all 10 products with different quantity & different price are coded and connected to the servlet. At a time i have to select alteast 5 products or more than 5 products so kindly can any help me how to write a code for this.

Posted by santosh on Thursday, 01.24.08 @ 10:38am | #45982

please include the output for each example so the users can cross check with their output

Posted by visakh m g on Friday, 12.1.06 @ 12:36pm | #310

Training Courses
Tell A Friend
Your Friend Name
Website Designing Services
 
Web Designing Packages From $150!
 
Website Designing Company Web Hosting
 
Website Designing Quotation
 
Search Tutorials:

 

 
 

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

Indian Software Development Company | iPhone Development Company in India | Flex Development Company in India | Java Training Delhi | Java Training at Noida |

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

Copyright © 2008. All rights reserved.