?
Solved

<How do I generate an array with the output of  1,0,0,0,0.....>

Posted on 2011-05-01
1
Medium Priority
?
340 Views
Last Modified: 2013-11-23
How do I generate an array with the output of  1,0,0,0,0.....</p>


public class chap7quiz9 </p>

{
public static void main(String[] args) </p>

{


int a[] = new int[24]; </p>

for(int i = 0;[ i<24];i++) </p>

{
a =1/(1+i); </p>

System.out.println(0);</p>

}
}
}
 


today230.JPG
0
Comment
Question by:waltbaby315
1 Comment
 
LVL 20

Accepted Solution

by:
Sathish David  Kumar N earned 2000 total points
ID: 35502893
public class chap7quiz9 </p>

{ 
public static void main(String[] args) </p>

{


int a[] = new int[24]; 
int b ;
for(int i = 0; i<24;i++) 

{
// a =1/(1+i);   i dont know why you puting this line 
b=24/(24-i);
System.out.println(b);

}
}
}

Open in new window

0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses
Course of the Month15 days, 6 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question