@Beatrice
hope this would help
//////////////////////
public class myArray{
public static void main(String [] args)
{
int []ages = new int[20]; //for 20 entries say
for(int count=0,value=100;count<20;count++,value++)
{
ages[count]=value;
}
//to print in another loop
for(int printCount=0;printCount<20;printCount++)
{
System.out.println(ages[printCount]);
}
}
}
///////////////////
On Aug 20, 11:24 am, Béatrice [email protected]
<[email protected]> wrote:
> Hi !
>
> I've a problem with the exercice My JavaArrayProject.
> Here's the question :
>
> Just before the for loop that prints out the value of each entry of
> the ages[] array, create another for loop in which a value of 100 is
> assigned to the first entry of the array, ages[0], 101 to the next
> entry of the array, ages[1], and so on.
>
> I don't know how to do it.
> Can you help me ?
> Thanks
>
> Beatrice
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---