Monday, May 3, 2010
Array
An array is a collection of individual values, all of the same data type, stored in adjacent memory locations. ... The individual values are referred to by using the array name together with an integral valued index in square brackets.
I will give a sample program using array, next lesson.
I will give a sample program using array, next lesson.
java programming
this is a book in java programming 4th edition. This book serves as your guide, as well as, your foundation to be the best java programmer ever.
Labels:
books in programming,
java programming.
Sunday, May 2, 2010
Do while Loop syntax in programming
the syntax of do while in programming:
initialization;
do
{
statements;
inc/dec;
}while(condition);
next Lesson i'll make a sample program using do while loop
initialization;
do
{
statements;
inc/dec;
}while(condition);
next Lesson i'll make a sample program using do while loop
Friday, April 30, 2010
for loop sample program
sample program using for loop in java.
this program will ask the user to input how many numbers they want to print:
import java.util.Scanner;
public class samplefor
{
public static void main(String args[])
{
Scanner input=new Scanner(System.in);
int num;
int x;
System.out.print("How many numbers you want to print:");
num=input.nextInt();
for(x=0; x<=num; x++)
{
System.out.println(x");
}
}
}
this program will ask the user to input how many numbers they want to print:
import java.util.Scanner;
public class samplefor
{
public static void main(String args[])
{
Scanner input=new Scanner(System.in);
int num;
int x;
System.out.print("How many numbers you want to print:");
num=input.nextInt();
for(x=0; x<=num; x++)
{
System.out.println(x");
}
}
}
Labels:
for loop,
input numbers,
looping,
util.scanner
Thursday, April 29, 2010
for Loop
for loop is a part of programming to execute program continuesly until it reaches the final looping of final number of loop.
example program.
int x;
for(x=0; x<=10; x++)
{
System.out.println(x);
}
sample output:
0
1
2
3
4
5
6
7
8
9
10
example program.
int x;
for(x=0; x<=10; x++)
{
System.out.println(x);
}
sample output:
0
1
2
3
4
5
6
7
8
9
10
Labels:
for loop,
looping,
program from 0 to 10
Tuesday, April 27, 2010
syntax in programming
syntax is a rules in programing.
for loop sysntax:
for(init; condition; inc/dec)
{
statements;
}
for loop sysntax:
for(init; condition; inc/dec)
{
statements;
}
Subscribe to:
Posts (Atom)