Scenario: There are 1 to 100 numbers. Each number should be
keep in the each column like from A column to Z column ie 1
to 26. From 27 to 52 should be in 2nd row in the excel
sheet. This has to be continue till 100. How do you write
Java program and what are various methods.
Answer Posted / ashwin khandelwal
public class NumPlacing {
int k=0;
int n=4;
int val=0;
int[]a=new int[101];
public void done(){
for(int j=0;j<n;j++){
if(val<101){
for(int i=0;i<26;i++){
val=val+1;
int count=i+1;
a[val]=val;
k++;
System.out.println(count+"->"+a[val]+"\t");
}
System.out.println("\n");
}
}
}
public static void main(String args[]){
NumPlacing num=new NumPlacing();
num.done();
}
}
| Is This Answer Correct ? | 8 Yes | 2 No |
Post New Answer View All Answers
Is hashset ordered java?
What technique is carried out to find out if a particular string is empty?
What types of index data structures can you have in java?
What is a memory leak in java?
What is difference between array and arraylist in java?
What is a package in java? List down various advantages of packages.
What is the size of arraylist in java?
What are the types of methods in java?
What is the difference between class & object?
Does hashset allow duplicates in java?
How we can generate random numbers in java?
Is java 1.7 the same as java 7?
What's the base class of all exception classes?
When do we use synchronized blocks and advantages of using synchronized blocks?
What is the abstract class?